enableScreenProtection method

  1. @override
Future<void> enableScreenProtection()
override

Enables screen protection (blocks screenshots and screen recording).

On Android, sets FLAG_SECURE — screenshots appear black and screen recordings show a blank/black screen.

On iOS, adds a secure text field overlay that obscures content in screenshots and screen recordings.

Implementation

@override
Future<void> enableScreenProtection() async {
  await methodChannel.invokeMethod<void>('enableScreenProtection');
}