screenshot_detect 1.0.3 icon indicating copy to clipboard operation
screenshot_detect: ^1.0.3 copied to clipboard

PlatformiOS

An iOS package for detecting when a user takes a screenshot and adding listeners to that action.

screenshot_detect #

This is an iOS-only plugin for detecting when user takes a screenshot through UIApplication.userDidTakeScreenshotNotification. It was heavily inspired by this package.

Getting Started #

  • Import the package

    import 'package:screenshot_detect/screenshot_detect.dart';
    
  • Create a ScreenshotDetect instance

     final ScreenshotDetect screenshotDetect = ScreenshotDetect();
    
  • Add an observer

     screenshotDetect.addListener(() {
              print('Taken screenshot')
          exampleFunction();
        });
    
  • Dispose when done

      @override
      void dispose() {
        screenshotDetect.dispose();
        super.dispose();
      }
    

Author #

  • glebosotov - gleb.osotov@gmail.com
4
likes
130
pub points
24%
popularity

Publisher

unverified uploader

An iOS package for detecting when a user takes a screenshot and adding listeners to that action.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on screenshot_detect