notify user when they try to use feature that hasn't been implemented
This commit is contained in:
parent
0f527212c5
commit
a14560d11f
|
@ -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<ScaffoldState> _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,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue