Search packages, repositories and app categories

Package detailsv3.0.1

screenshot_callback

Flutter plugin that allows you to detect mobile screenshot and execute callback functions on iOS and Android.

AndroidiOS
30-day downloads
7.1K
Likes
101
Pub points
150

Install package

flutter pub add screenshot_callback

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The screenshot_callback package is a Flutter plugin that enables detection of mobile screenshots on both Android and iOS devices. It triggers callback functions when a screenshot is taken, allowing developers to respond dynamically—such as by pausing sensitive content or logging events. Built for cross-platform compatibility, it integrates seamlessly into existing Flutter apps without requiring native code changes. The plugin leverages platform-specific APIs to monitor screenshot activity efficiently and reliably.

Use cases

  • Detecting when users take screenshots in sensitive apps
  • Triggering security measures upon screenshot detection
  • Logging screenshot events for analytics
  • Preventing unauthorized screen captures
  • Enabling responsive UI adjustments after screenshots

Key features

  • Cross-platform support for Android and iOS
  • Simple callback execution on screenshot detection
  • Minimal setup with pub add command
  • Secure and lightweight implementation
  • No need for native code modification

Suitable for

  • Apps requiring screenshot protection
  • Security-focused applications
  • Educational or exam-like environments
  • Content providers needing usage tracking
  • Developers building privacy-aware features

Considerations

  • Requires appropriate permissions on Android
  • Limited to detecting screenshots, not preventing them
  • May not work on all device models or OS versions
  • Behavior can vary between iOS and Android
  • Does not guarantee 100% detection accuracy across all scenarios

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Screenshot Callback

Flutter plugin that allows you to detect mobile screenshot and execute callback functions on iOS and Android. 🚀

Usage • Issues and Feedback • Author • License

Feedback welcome and Pull Requests are most welcome!

Usage

Import the package

To use this plugin, follow the plugin installation instructions.

Use the plugin

Add the following import to your Dart code:

import 'package:screenshot_callback/screenshot_callback.dart';

Initialize ScreenshotCallback with the scopes you want:

ScreenshotCallback screenshotCallback = ScreenshotCallback();
addListener

Then invoke addListener method of ScreenshotCallback. Add custom functions that you want to excute after detect screenshot. e.g:

screenshotCallback.addListener(() {
  //Void funtions are implemented
  print('detect screenshot');
});
dispose

You need to call dispose method to terminate ScreenshotCallback before you exit the app e.g:

screenshotCallback.dispose();

Issues and Feedback

Please file issues to send feedback or report a bug. Thank you !

Author

License

MIT

Categories

Source repository

Projects using this package

No data available yet.