configure static method

Future<void> configure({
  1. bool includeDeviceInfo = false,
  2. bool ignoreNonSensitiveScreens = false,
  3. bool autoProtectSensitiveScreens = false,
  4. bool blurOnScreenshotDetected = false,
  5. bool enableScreenshotDetection = true,
  6. bool enableRecordingDetection = true,
  7. bool enableProtection = false,
  8. int maxLogEntries = 1000,
  9. SecurityEventDispatcher? dispatcher,
  10. SecurityEventCallback? onScreenshot,
  11. SecurityEventCallback? onRecordingStart,
  12. 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);
}