configure static method
Future<void>
configure({
- bool includeDeviceInfo = false,
- bool ignoreNonSensitiveScreens = false,
- bool autoProtectSensitiveScreens = false,
- bool blurOnScreenshotDetected = false,
- bool enableScreenshotDetection = true,
- bool enableRecordingDetection = true,
- bool enableProtection = false,
- int maxLogEntries = 1000,
- SecurityEventDispatcher? dispatcher,
- SecurityEventCallback? onScreenshot,
- SecurityEventCallback? onRecordingStart,
- SecurityEventCallback? onRecordingStop,
Modular configuration requested by app developers.
Implementation
static Future<void> configure({
bool includeDeviceInfo = false,
bool ignoreNonSensitiveScreens = false,
bool autoProtectSensitiveScreens = false,
bool blurOnScreenshotDetected = false,
bool enableScreenshotDetection = true,
bool enableRecordingDetection = true,
bool enableProtection = false,
int maxLogEntries = 1000,
SecurityEventDispatcher? dispatcher,
SecurityEventCallback? onScreenshot,
SecurityEventCallback? onRecordingStart,
SecurityEventCallback? onRecordingStop,
}) async {
_ensureInitialized();
_includeDeviceInfo = includeDeviceInfo;
_ignoreNonSensitiveScreens = ignoreNonSensitiveScreens;
_autoProtectSensitiveScreens = autoProtectSensitiveScreens;
_blurOnScreenshotDetected = blurOnScreenshotDetected;
_enableScreenshotDetection = enableScreenshotDetection;
_enableRecordingDetection = enableRecordingDetection;
_enableProtection = enableProtection;
_maxLogEntries = maxLogEntries.clamp(50, 20000).toInt();
_eventDispatcher = dispatcher;
_onScreenshotCallback = onScreenshot;
_onRecordingStartCallback = onRecordingStart;
_onRecordingStopCallback = onRecordingStop;
await setScreenshotProtectionEnabled(enabled: _enableProtection);
}