In this case I will disable the screen capture on certain pages. which contains documents that are vulnerable to misuse. Does Flutter support that?
this code main.dart:
Future<void> _toggleScreenShot() async {
if (_isSecureScreen == true) {
await FlutterWindowManager
.addFlags(FlutterWindowManager.FLAG_SECURE);
print("Tidak bisa ");
} else {
await FlutterWindowManager
.clearFlags(FlutterWindowManager.FLAG_SECURE);
print("Tidak bisa ");
}
setState(() {
_isSecureScreen = !_isSecureScreen;
});
}
this code mainactivity.kt :
@Override
fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}