Real fullscreen for camera view

This commit is contained in:
Yegor Vialov 2020-05-29 16:52:57 +00:00
parent 78893ea01f
commit 096e714a04

View File

@ -1,18 +1,37 @@
part of '../main.dart';
class FullScreenPage extends StatelessWidget {
class FullScreenPage extends StatefulWidget {
final Widget child;
const FullScreenPage({Key key, this.child}) : super(key: key);
@override
_FullScreenPageState createState() => _FullScreenPageState();
}
class _FullScreenPageState extends State<FullScreenPage> {
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black,
child: Center(
child: this.child,
child: this.widget.child,
),
);
}
@override
void dispose() {
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
super.dispose();
}
}