mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-08 00:02:05 +00:00
Refactor "drawer"
- Reduce number of items - Long-pressing the "back" button opens the drawer Ref: https://stackoverflow.com/questions/58095547/flutter-scaffold-ofcontext-opendrawer-doesnt-work
This commit is contained in:
1 parent
4f8794e652
commit
18479b88e3
3 files changed
+18
-99
No files matched your search
@@ -7,13 +7,15 @@
|
||||
import "package:flutter/cupertino.dart";
|
||||
import "package:flutter/material.dart";
|
||||
|
||||
Widget backButton(BuildContext context) {
|
||||
import "package:inventree/widget/drawer.dart";
|
||||
|
||||
Widget backButton(BuildContext context, GlobalKey<ScaffoldState> key) {
|
||||
|
||||
return GestureDetector(
|
||||
onLongPress: () {
|
||||
while (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
// Display the menu
|
||||
key.currentState!.openDrawer();
|
||||
print("hello?");
|
||||
},
|
||||
child: IconButton(
|
||||
icon: BackButtonIcon(),
|
||||
|
||||
Reference in new issue
Block a user