Simplify hiding the appbar

This commit is contained in:
krawieck 2020-09-11 11:00:04 +02:00
parent 13b1a7ad8b
commit a8607fd661
1 changed files with 9 additions and 10 deletions

View File

@ -28,13 +28,12 @@ class MediaView extends HookWidget {
} }
return Scaffold( return Scaffold(
appBar: AppBar( appBar: showButtons.value
backgroundColor: ? AppBar(
showButtons.value ? Colors.black38 : Colors.transparent, backgroundColor: Colors.black38,
shadowColor: Colors.transparent, shadowColor: Colors.transparent,
leading: showButtons.value ? CloseButton() : Container(), leading: CloseButton(),
actions: showButtons.value actions: [
? [
IconButton( IconButton(
icon: Icon(Icons.share), icon: Icon(Icons.share),
tooltip: 'share', tooltip: 'share',
@ -45,9 +44,9 @@ class MediaView extends HookWidget {
tooltip: 'download', tooltip: 'download',
onPressed: () {}, onPressed: () {},
), ),
] ],
: null, )
), : null,
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: GestureDetector( body: GestureDetector(
onTapUp: (details) => showButtons.value = !showButtons.value, onTapUp: (details) => showButtons.value = !showButtons.value,