Enter fullscreen when hiding buttons
This commit is contained in:
parent
5fa9e22cd5
commit
13b1a7ad8b
|
@ -1,5 +1,6 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
|
@ -12,6 +13,20 @@ class MediaView extends HookWidget {
|
|||
Widget build(BuildContext context) {
|
||||
var showButtons = useState(true);
|
||||
|
||||
useEffect(() => () => SystemChrome.setEnabledSystemUIOverlays([
|
||||
SystemUiOverlay.bottom,
|
||||
SystemUiOverlay.top,
|
||||
]));
|
||||
|
||||
if (showButtons.value) {
|
||||
SystemChrome.setEnabledSystemUIOverlays([
|
||||
SystemUiOverlay.bottom,
|
||||
SystemUiOverlay.top,
|
||||
]);
|
||||
} else {
|
||||
SystemChrome.setEnabledSystemUIOverlays([]);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
|
|
Loading…
Reference in New Issue