flutter_privacy_screen 0.0.1 flutter_privacy_screen: ^0.0.1 copied to clipboard
A flutter plugin that blurs / blacks the screen in the task manager.
import 'package:flutter/material.dart';
import 'package:flutter_privacy_screen/flutter_privacy_screen.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState 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: <Widget>[
FlatButton(
child: Text("Enable privacy screen"),
onPressed: () async {
await FlutterPrivacyScreen.enablePrivacyScreen();
},
),
FlatButton(
child: Text("Disable privacy screen"),
onPressed: () async {
await FlutterPrivacyScreen.disablePrivacyScreen();
},
)
],
)),
),
);
}
}