prevent_app_screen 0.1.2 copy "prevent_app_screen: ^0.1.2" to clipboard
prevent_app_screen: ^0.1.2 copied to clipboard

A Flutter plugin to prevent screenshots and screen recordings on Android, iOS, macOS, Windows, Linux, and Web.

๐Ÿ›ก๏ธ Prevent App Screen #

Pub Version License Platform Support

A powerful, high-performance Flutter plugin designed to protect your application from Screenshots and Screen Recordings. Ideal for banking apps, streaming platforms, and privacy-focused tools.


โœจ Key Features #

  • ๐Ÿš€ Global Protection: Secure your entire app with a single line of code.
  • ๐Ÿ’ป Cross-Platform: Full support for Android, iOS, macOS, Windows, Linux, and Web.
  • ๐Ÿ“ฑ Screen-Level Security: Dynamic protection that activates/deactivates per route.
  • ๐ŸŒซ๏ธ Granular Masking: Blur or hide specific UI components (e.g., Credit Card numbers).
  • ๐Ÿ”„ App Switcher Blur: Automatically hides app content in multitasking views.
  • ๐ŸŽฅ Recording Detection: Real-time detection and response to screen recordings and mirroring.

๐Ÿš€ Getting Started #

Installation #

Add the dependency to your pubspec.yaml:

dependencies:
  prevent_app_screen: ^0.1.2

Basic Initialization #

For the best security, initialize the plugin in your main() method to protect the entire application from the start.

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Enable protection globally
  PreventAppScreen.initialize(true); 
  
  runApp(const MyApp());
}

๐ŸŒŸ Protection Levels #

1๏ธโƒฃ Full Screen Protection #

Wrap specific screens to block screenshots and recording ONLY while that specific page is visible. Useful for login or profile pages.

@override
Widget build(BuildContext context) {
  return FullScreenProtection(
    prevent: true,
    child: Scaffold(
      appBar: AppBar(title: Text("Sensitive Info")),
      body: MyPrivateContent(),
    ),
  );
}

2๏ธโƒฃ Granular Widget Masking #

Use SpecificWidgetProtection to protect specific UI elements. You can choose between a Blur effect or a custom Placeholder.

SpecificWidgetProtection(
  protectWindow: true,   // Blocks the ENTIRE screenshot/recording while visible
  blurAmount: 15.0,      // Intensity of the blur
  placeholder: BlackBox(), // Optional: Show a custom widget instead of blurring
  child: CreditCardWidget(),
)
Parameter Type Description
protectWindow bool Proactive: Secure the whole window as long as this widget is on screen.
prevent bool Reactive: Auto-blur the widget if a screen recording starts (Mobile).
forceBlur bool Manual: Always blur the widget regardless of capture status.
placeholder Widget? Display this widget instead of applying a blur effect.

๐Ÿ” Platform Support & Details #

Feature Android iOS macOS Windows Linux Web
Screenshot Blocking โœ… โœ… โœ… โœ… โš ๏ธยน โš ๏ธยฒ
Recording Prevention โœ… โœ… โœ… โœ… โš ๏ธยน โš ๏ธยฒ
App Switcher Blur โœ… โœ… N/A N/A N/A N/A
Capture Detection โœ… โœ… โŒ โŒ โŒ โŒ

Platform Notes #

  • ยน Linux: Screenshot prevention is compositor-dependent (X11/Wayland). The plugin provides a success response but actual blocking varies by environment.
  • ยฒ Web: Browsers do not provide APIs to block screenshots. The plugin applies user-select: none to the body as a deterrent.
  • macOS/Windows: Uses native window affinity APIs to prevent capture by other applications.

๐Ÿ“ License #

This project is licensed under the MIT License - see the LICENSE file for details.

1
likes
0
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to prevent screenshots and screen recordings on Android, iOS, macOS, Windows, Linux, and Web.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on prevent_app_screen

Packages that implement prevent_app_screen