Closed mark8044 closed 3 years ago
Wait, I think reading your documentation I figured it out, is this correct? It seems to be working for me atleast
return BottomNavLayout(
// The app's destinations
pages: [
(navKey) => Navigator(
key: navKey,
initialRoute: "/",
onGenerateRoute: (routeSettings) => MaterialPageRoute(
builder: (context) {
return NewsScreen();
},
),
),
(navKey) => Navigator(
key: navKey,
initialRoute: "/",
onGenerateRoute: (routeSettings) => MaterialPageRoute(
builder: (context) {
return TextbookScreen();
},
),
),
(navKey) => Navigator(
key: navKey,
initialRoute: "/",
onGenerateRoute: (routeSettings) => MaterialPageRoute(
builder: (context) {
return ArticleScreen();
},
),
),
],
You figured it out yourself.
If the Navigator you are pushing to is above the BottomNavLayout in the widget tree, it will replace the entire widget tree below the navigator, resulting in the bottom navigator being gone.
Solution is to wrap your pages with a Navigator as @mark8044 showed or as shown in the documentation.
First off all, the package looks great so far.
One key requirement some (myself included) may have: Persistent bar.
We want our bottom navigation bar to always show, no matter what page is navigated to. currently, a new page will cover the bottom navigation bar.
Can it somehow optionally be programmed to maintain the bottom nav bar at all times?