prohibit_screen 0.0.5 copy "prohibit_screen: ^0.0.5" to clipboard
prohibit_screen: ^0.0.5 copied to clipboard

Disable screenshots and screen recordings, support iOS and Android.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:prohibit_screen/prohibit_screen.dart';

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

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

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

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              GestureDetector(
                onTap: () {
                  ProhibitScreen().screenshotOFF();
                },
                child: Container(
                  color: Colors.red,
                  width: 80,
                  height: 40,
                  alignment: Alignment.center,
                  child: const Text('OFF'),
                ),
              ),
              const SizedBox(height: 20,),
              GestureDetector(
                onTap: () {
                  ProhibitScreen().screenshotON();
                },
                child: Container(
                  color: Colors.green,
                  width: 80,
                  height: 40,
                  alignment: Alignment.center,
                  child: const Text('ON'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
120
pub points
50%
popularity

Publisher

unverified uploader

Disable screenshots and screen recordings, support iOS and Android.

Repository (GitHub)
View/report issues

Topics

#platform #info #cross-platform #device #information

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on prohibit_screen