Prevent User To Take Screenshot In Flutter

flutter_windowmanager: ^0.0.2
$ flutter pub get
import 'package:flutter_windowmanager/flutter_windowmanager.dart';
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);
initState() {
super.initState();
_preventScreenshot();
}

Future<void> _preventScreenshot() async {
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);
}

--

--

--

Flutter || Android Developer Since 2018

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Android Studio 4.0 — Motion Editor

Flutter on MAC

Day 1 : Learning Android

2D Galaxy Shooter — Implementing a Thruster Speed Boost

Using Android Content Providers for Automatically Initialization

Jetpack Compose: Beginner to Advanced

Gradle: Print dependency graph on Terminal for your Android App

Android: Sticky view at the bottom of bottom sheet dialog fragment

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshay Papneja

Akshay Papneja

Flutter || Android Developer Since 2018

More from Medium

Flutter Stack Weekly — Issue #2

Flutter EventChannel

flutter even channel

How to Use a Ternary Operator with Multiple Condition In Flutter?

Remove OverScroll Shadow in Flutter