Start a Project

Prevent screenshots/video recording in flutter.

Nowadays, user data security is a foremost priority. So, it is necessary to disable screenshots/ video recordings in the apps. You must have seen that a good number of apps like banking apps don’t allow you to take screenshots or record a video.

Now, let’s check how can we prevent screenshots/video recording in Flutter apps. In Flutter, we can use the flutter_windowmanager package to implement this functionality.

You may also check our Flutter app development services page.

Create a new flutter project and add this package to your project:

FlutterWindowManager.FLAG_SECURE: enables secure mode for the app, and disables screenshots, and screen recording.

You can clear and add flags according to your requirements. This package also provides several flags that help us implement functionalities.

FULL CODE:

OUTPUT:

https://mobikul.com/wp-content/uploads/2023/09/XRecorder_29092023_140855-1.mp4

When the secure flag is enabled, there is a notification to show inform regarding the disabled screenshot.

There is a drawback to this package that it doesn’t support iOS and as mentioned in the documentation there is no iOS support planned or possible. 

Conclusion:

In this article, I have explained how to prevent screenshots/video recording in the Flutter app.

Thanks for reading this article.

If I got something wrong, let me know in the comments. I would love to improve.

Reference link:

https://pub.dev/packages/flutter_windowmanager

Check out these interesting flutter topics:

Exit mobile version