I have a BottomNavigation bar, and I have Nested navigation for it, but I also need a Scaffold for every new page in the Top level screen. I get that nested Scaffold is not recommended and I also have a resizeToAvoidBottomInset
problem when I use nested Scaffolds.
My Tab navigator:
@override
Widget build(BuildContext context) {
Widget child;
if (tabItem == "Home") {
child = const Home();
} else if (tabItem == 'screen2') {
child = Screen2();
} else if (tabItem == 'screen3') {
child = const Screen3();
} else if (tabItem == 'screen4') {
child = const Screen4(0);
} else if (tabItem == 'Screen5') {
child= Screen5();
} else {
child = const Home();
}
return Navigator(
key: navigatorKey,
onGenerateRoute: (routeSettings) {
return MaterialPageRoute(builder: (context) => child);
},
);
}
- I dont want to use Cupertino or custom Navigation bars, I want to do it with Material.dart only
- I have tried To add a MaterialApp within the Top Level material app, which works, but there has to be a better way