Skip to content

Commit

Permalink
Fix bottom navbar route handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Process-ing committed Jan 18, 2024
1 parent 95bb8bf commit b1a71c7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class AppBottomNavbarState extends State<AppBottomNavbar> {
.map((item) => item.toBottomNavigationBarItem())
.toList();

String _getCurrentRoute() =>
ModalRoute.of(widget.parentContext)!.settings.name == null
? DrawerItem.navPersonalArea.title
: ModalRoute.of(widget.parentContext)!.settings.name!.substring(1);
String? _getCurrentRoute() =>
ModalRoute.of(widget.parentContext)!.settings.name?.substring(1);

int _getCurrentIndex() {
final currentRoute = _getCurrentRoute();
if (_getCurrentRoute() == null) {
return -1;
}

for (final item in NavbarItem.values) {
if (item.routes.contains(currentRoute)) {
Expand Down

0 comments on commit b1a71c7

Please sign in to comment.