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

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:no_screenshot/no_screenshot.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _noScreenshot = NoScreenshot.instance;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('NoScreenShot Plugin app'),
        ),
        body: Center(
            child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            ElevatedButton(
              child: const Text('Press to toggle screenshot'),
              onPressed: () async {
                final result = await _noScreenshot.toggleScreenshot();
                debugPrint(result.toString());
              },
            ),
            ElevatedButton(
              child: const Text('Press to turn off screenshot'),
              onPressed: () async {
                final result = await _noScreenshot.screenshotOff();
                debugPrint(result.toString());
              },
            ),
            ElevatedButton(
              child: const Text('Press to turn on screenshot'),
              onPressed: () async {
                final result = await _noScreenshot.screenshotOn();
                debugPrint(result.toString());
              },
            ),
          ],
        )),
      ),
    );
  }
}
111
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