This is a private Flutter package designed to detect screenshots taken on native Swift (iOS) and Android platforms and notify the Flutter layer.
- Detects screenshots on iOS (using Swift) and Android (using native code).
- Provides screenshot detection information to Flutter for further handling.
Add the package to your pubspec.yaml
under dependencies
:
dependencies:
screenshot_detection:
git:
url: git@your_private_repository_url.git
ref: main # Replace with the correct branch or tag
Run flutter pub get to install the package.
The package provides a stream that allows you to listen for screenshot events.
ScreenshotDetector.instance.startListening.listen(() {
// Handle screenshot event
print("Screenshot detected!");
});
The package provides a stream that allows you to listen for screenshot events.
ScreenShotDetectorWrapper(
replaceChild: const Text('Screenshot Detected'),
child: TextButton(
onPressed: () => {},
child: const Text(
'Share',
),
),
)
This is a private package. Contributions are welcome only from authorized members.
This package is under a private license. Distribution or usage outside authorized channels is prohibited.