bizz84 / nested-navigation-demo-flutter

Nested navigation with BottomNavigationBar

Home Page:https://codewithandrea.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter BottomNavigationBar with Multiple Navigators

This is the source code for my article:

Preview

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?

  • Create an app with a Scaffold and a BottomNavigationBar.
  • In the Scaffold body, create a Stack with one child for each tab.
  • Each child is an Offstage widget with a child Navigator.
  • Don't forget to handle Android back navigation with WillPopScope.

Read the full story on my article:

Credits

  • Brian Egan: for suggesting to use Stack + Offstage & Navigator widgets.

About

Nested navigation with BottomNavigationBar

https://codewithandrea.com/

License:MIT License


Languages

Language:Dart 62.7%Language:HTML 27.4%Language:Swift 8.5%Language:Kotlin 1.2%Language:Objective-C 0.3%