no_screenshot 0.0.1+1 copy "no_screenshot: ^0.0.1+1" to clipboard
no_screenshot: ^0.0.1+1 copied to clipboard

outdated

Flutter plugin to enable, disable or toggle screenshot support in your application.

no_screenshot #

Flutter plugin to enable, disable or toggle screenshot support in your application.

Getting Started #

If you want to prevent user from taking screenshot or recording of your app. You can turn off the screenshot support from the root didChangeAppLifecycleState method.

    class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
    final _noScreenshot = NoScreenshot();

  AppLifecycleState? _notification; 
  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
      case AppLifecycleState.resumed, :
        print("app in resumed");
        if(app_secure) _noScreenshot.screenshotOff();
        break;
      case AppLifecycleState.inactive:
        print("app in inactive");
        if(app_secure) _noScreenshot.screenshotOff();

        break;
      case AppLifecycleState.paused:
        print("app in paused");
        if(app_secure) _noScreenshot.screenshotOff();
        break;
      case AppLifecycleState.detached:
        print("app in detached");
        break;
    }
  }

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance?.addObserver(this);
    ...
  }

  @override
  void dispose() {
    WidgetsBinding.instance?.removeObserver(this);
    super.dispose();
  }
120
likes
0
pub points
97%
popularity

Publisher

verified publisherflutterplaza.com

Flutter plugin to enable, disable or toggle screenshot support in your application.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on no_screenshot