Overview
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