screen_capture_restrictions 1.0.0
screen_capture_restrictions: ^1.0.0 copied to clipboard
A flutter plugins to restrictions to screen capture on mobile platforms.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:screen_capture_restrictions/screen_capture_restrictions.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
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Screen Capture Restrictions Sample.'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: const Text('Enable Secure'),
onTap: () async {
await ScreenCaptureRestrictions.enableSecure();
},
),
const SizedBox(height: 50),
InkWell(
child: const Text('Disable Secure'),
onTap: () async {
await ScreenCaptureRestrictions.disableSecure();
},
),
],
),
),
),
);
}
}