secure_screen_wrapper 1.0.2 copy "secure_screen_wrapper: ^1.0.2" to clipboard
secure_screen_wrapper: ^1.0.2 copied to clipboard

Prevent screenshots on Android, iOS, and Web. Blocks screenshots on Android, makes them black on iOS, and adds protection layers on Web.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Secure Screen Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool _isSecure = true;

  @override
  Widget build(BuildContext context) {
    return SecureScreenWrapper(
      enabled: _isSecure,
      child: Scaffold(
        appBar: AppBar(title: const Text('Secure Screen Demo')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Icon(Icons.security, size: 100, color: Colors.blue),
              const SizedBox(height: 20),
              Text(
                _isSecure ? 'Screen is Secured' : 'Screen is Not Secured',
                style: Theme.of(context).textTheme.headlineSmall,
              ),
              const SizedBox(height: 20),
              const Padding(
                padding: EdgeInsets.all(16.0),
                child: Text(
                  'Try taking a screenshot:\n'
                  '• Android: Screenshot blocked\n'
                  '• iOS: Screenshot appears black',
                  textAlign: TextAlign.center,
                ),
              ),
              const SizedBox(height: 40),
              ElevatedButton(
                onPressed: () {
                  setState(() {
                    _isSecure = !_isSecure;
                  });
                },
                child: Text(_isSecure ? 'Disable Security' : 'Enable Security'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
169
downloads

Publisher

unverified uploader

Weekly Downloads

Prevent screenshots on Android, iOS, and Web. Blocks screenshots on Android, makes them black on iOS, and adds protection layers on Web.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on secure_screen_wrapper

Packages that implement secure_screen_wrapper