We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4882d04 + 1180864 commit 8b3ecffCopy full SHA for 8b3ecff
lib/app/routes/screen_extension.dart
@@ -110,11 +110,14 @@ extension ScreenExtension on Screen {
110
111
extension RoleExtension on Role {
112
int getCurrentIndexFromRoute(GetNavConfig? currentRoute) {
113
- final String? currentLocation = currentRoute?.location;
+ final String? currentLocation = currentRoute?.uri.path;
114
int currentIndex = 0;
115
if (currentLocation != null) {
116
- currentIndex =
117
- tabs.indexWhere((tab) => currentLocation.startsWith(tab.path));
+ currentIndex = tabs.indexWhere((tab) {
+ String parentPath = tab.parent?.path ?? '';
118
+ String fullPath = '$parentPath${tab.path}';
119
+ return currentLocation.startsWith(fullPath);
120
+ });
121
}
122
return (currentIndex > 0) ? currentIndex : 0;
123
0 commit comments