Flutter: Keep BottomNavigationBar When Push to New Screen with Navigator

后端 未结 10 753
情深已故
情深已故 2020-12-25 12:55

In iOS, we have a UITabBarController which stays permanently at the bottom of the screen when we push to a new ViewController.

In Flutter, we have a bottomNavigation

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-25 13:48

    You need to create MaterialApp with routes and make BottomNavigationBar a sibling of it. Then use MaterialApp.navigatorKey which you pass to BottomNavigationBar to do navigation.

    https://medium.com/@swav.kulinski/flutter-navigating-off-the-charts-e118562a36a5

提交回复
热议问题