This is the source code for my article:
In this example each tab has its own navigation stack. This is so that we don’t lose the navigation history when switching tabs.
This is a very common use case for a lot of apps.
How is it built?
Scaffold
and a BottomNavigationBar
.Scaffold
body, create a Stack
with one child for each tab.Offstage
widget with a child Navigator
.WillPopScope
.Read the full story on my article:
Stack
+ Offstage
& Navigator
widgets.