screenshot_callback 0.0.2 copy "screenshot_callback: ^0.0.2" to clipboard
screenshot_callback: ^0.0.2 copied to clipboard

outdated

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

screenshot_callback #

pub package

A Flutter plugin for iOS and Android for detecting screenshot.

Note: This plugin is still under development, and we will add features such as importing screenshot image. Feedback welcome and Pull Requests are most welcome!

Usage #

Import the package #

To use this plugin, follow the plugin installation instructions.

Android #

Android detects external storage to determine if a screenshot has occurred. So you need permission to external storage. Use the following links if necessary.

iOS #

No action is required. Screenshots can be detected by the plug-in itself.

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:

!!! It must be created after permission is granted. (Android only)

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 !

75
likes
0
pub points
92%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on screenshot_callback