BilalShahid13 / PersistentBottomNavBar

A highly customizable persistent bottom navigation bar for Flutter
BSD 3-Clause "New" or "Revised" License
507 stars 371 forks source link

How tu use named routes #303

Open aymaalo opened 1 year ago

aymaalo commented 1 year ago

I would like to know how to properly config the PersistentBottomNavBarItems so I can use pushNamed and not the pushNewScreen() function

Here is my current config that doesn't work

 final bottomNavigationBarItems = provider.navScreens
            .map(
              (screen) => PersistentBottomNavBarItem(
                routeAndNavigatorSettings: RouteAndNavigatorSettings(
                    onGenerateRoute: screen.onGenerateRoute,
                    initialRoute: screen.initialRoute,
                    navigatorKey: screen.navigatorState),
                inactiveIcon: screen.icon,
                icon: screen.activeIcon!,
                iconSize: 28,
                title: screen.title,
                activeColorPrimary: themeColors(context).primary,
                inactiveColorPrimary: themeColors(context).primary,
              ),
            )
            .toList();

The thing is that navigation works good with Navigator.of(context).pushNamed but i'm trying to use popAllScreensOnTapOfSelectedTab: true, on my PersistentTabView.custom but it doesn't work at all. Nothing happen

Please help.

AndryCU commented 1 year ago

Any update?