setCurrentScreen static method

Future<void> setCurrentScreen({
  1. required String name,
  2. String type = 'custom',
  3. bool isSensitive = false,
})

Implementation

static Future<void> setCurrentScreen({
  required String name,
  String type = 'custom',
  bool isSensitive = false,
}) async {
  _ensureInitialized();
  _currentScreen = ScreenContext(
    name: name,
    type: type,
    isSensitive: isSensitive,
  );

  if (_enableProtection && _autoProtectSensitiveScreens) {
    await setScreenshotProtectionEnabled(enabled: isSensitive);
  }
}