Welcome to Prevent Screenshot Flutter-App 👋
A simple addition in the MainActivity.kt prevents user taking the screenshots.
Code :
import io.flutter.embedding.android.FlutterActivity
import android.view.WindowManager.LayoutParams
import io.flutter.embedding.engine.FlutterEngine
class MainActivity: FlutterActivity()
{
override fun configureFlutterEngine(flutterEngine: FlutterEngine)
{
window.addFlags(LayoutParams.FLAG_SECURE)
super.configureFlutterEngine(flutterEngine)
}
}
APP PREVIEW
Install
flutter pub get
Usage
flutter run
Run tests
f5 / debug
Author
👤 Akshat Sachan
- Website: sachan.netlify.com
- Twitter: SachanAK36
- Github: CryptocoderAS
- LinkedIn: Akshat Sachan
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2021 Akshat Sachan.
This project is Open Source licensed.