From a14560d11f2fa0a60f3eaef12aaaab37b01e3f80 Mon Sep 17 00:00:00 2001 From: krawieck Date: Tue, 6 Oct 2020 22:37:24 +0200 Subject: [PATCH] notify user when they try to use feature that hasn't been implemented --- lib/pages/media_view.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pages/media_view.dart b/lib/pages/media_view.dart index efd251e..378cf75 100644 --- a/lib/pages/media_view.dart +++ b/lib/pages/media_view.dart @@ -10,14 +10,20 @@ import '../widgets/bottom_modal.dart'; /// View to interact with a media object. Zoom in/out, download, share, etc. class MediaViewPage extends HookWidget { final String url; + final GlobalKey _key = GlobalKey(); - const MediaViewPage(this.url); + MediaViewPage(this.url); @override Widget build(BuildContext context) { final showButtons = useState(true); final isZoomedOut = useState(true); + notImplemented() { + _key.currentState.showSnackBar(SnackBar( + content: Text("this feature hasn't been implemented yet 😰"))); + } + useEffect(() { if (showButtons.value) { SystemChrome.setEnabledSystemUIOverlays([ @@ -57,6 +63,7 @@ class MediaViewPage extends HookWidget { title: Text('Share file'), onTap: () { Navigator.of(context).pop(); + notImplemented(); // TODO: share file }, ), @@ -67,6 +74,7 @@ class MediaViewPage extends HookWidget { } return Scaffold( + key: _key, extendBodyBehindAppBar: true, extendBody: true, appBar: showButtons.value @@ -83,7 +91,7 @@ class MediaViewPage extends HookWidget { IconButton( icon: Icon(Icons.file_download), tooltip: 'download', - onPressed: () {}, + onPressed: notImplemented, ), ], )