prohibit_screen 0.0.1
prohibit_screen: ^0.0.1 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'),
),
),
],
),
),
),
);
}
}