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

A flutter package to protect sensitive data by preventing screenshots in both Android and iOS

example/lib/main.dart

import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:better_screenshot_prevention/better_screenshot_prevention.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              Text('Screenshot This'),
              ElevatedButton(
                  onPressed: () async {
                    await BetterScreenshotPrevention.preventScreenshot;
                    log("try to screenshot now, i bet you cant 😎");
                  },
                  child: const Text("disallow SS")),
              ElevatedButton(
                  onPressed: () async {
                    await BetterScreenshotPrevention.allowScreenshot;
                    log("you might screenshot again 😎");
                  },
                  child: const Text("allow SS")),
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
91
downloads

Publisher

verified publisherjhonaiquel.com

Weekly Downloads

A flutter package to protect sensitive data by preventing screenshots in both Android and iOS

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on better_screenshot_prevention