Per-tab navigation stacks with StatefulShellRoute
WHAT IT TESTS: building independent per-tab stacks. OUTLINE: StatefulShellRoute keeps a separate Navigator and preserved state per branch, with a shared shell scaffold. RED FLAG: rebuilding tab contents or losing scroll and stack on tab switch.
WHAT IT TESTS: whether you can give each bottom-nav tab its own persistent navigation history. ANSWER OUTLINE: StatefulShellRoute.indexedStack defines a list of StatefulShellBranch entries, each owning its own Navigator and route subtree; the shell builder renders the persistent Scaffold and BottomNavigationBar and switches branches via navigationShell.goBranch. State, scroll position and the inner stack survive tab changes.
Read the original → interview
- #flutter
- #go_router
- #navigation
- #bottomnavigationbar
- #routing
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.