-
-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Giving that my app is using a same GNav navigator for guest and logged in users, I want to limit guest's access to my app by disabling some nav tabs (grey out icon, disable onPress). But even if I didn't change the _selectedIndex, the navigator still switched the tabs.
I see that in your gnav.dart code there is no way to prevent switching tab:
onPressed: () {
if (!clickable) return;
setState(() {
selectedIndex = widget.tabs.indexOf(t);
clickable = false;
});
t.onPressed?.call();
widget.onTabChange?.call(selectedIndex);
Future.delayed(widget.duration, () {
setState(() {
clickable = true;
});
});
},
Can we add a disable state for GButton?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request