long press menu to open settings
This commit is contained in:
+1
@@ -209,6 +209,7 @@ final List<ToolbarButtonDefinition> toolbarButtonRegistry = [
|
||||
spec: navigationMenuToolbarButtonSpec,
|
||||
label: 'Menu',
|
||||
icon: Icons.more_vert,
|
||||
longPressActions: ['Open Settings'],
|
||||
builder: (scope, context, ref) => scope.isPreview
|
||||
? NavigationMenuButtonView(onTap: () {})
|
||||
: NavigationMenuButton(selectedTabId: scope.selectedTabId),
|
||||
|
||||
+10
-2
@@ -81,18 +81,26 @@ class NavigationMenuButton extends StatelessWidget {
|
||||
onTap: () async {
|
||||
await showBrowserMenuSheet(context);
|
||||
},
|
||||
onLongPress: () async {
|
||||
await SettingsRoute().push(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NavigationMenuButtonView extends StatelessWidget {
|
||||
const NavigationMenuButtonView({super.key, this.onTap});
|
||||
const NavigationMenuButtonView({super.key, this.onTap, this.onLongPress});
|
||||
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onLongPress;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ToolbarButton(onTap: onTap, child: const Icon(Icons.more_vert));
|
||||
return ToolbarButton(
|
||||
onTap: onTap,
|
||||
onLongPress: onLongPress,
|
||||
child: const Icon(Icons.more_vert),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user