How to preserve widget states in flutter, when navigating using BottomNavigationBar?

后端 未结 6 1436
青春惊慌失措
青春惊慌失措 2020-11-27 12:20

I\'m currently working on building a Flutter app that will preserve states when navigating from one screen, to another, and back again when utilizing BottomNavigationBar. Ju

6条回答
  •  萌比男神i
    2020-11-27 13:07

    The most convenient way I have found to do so is using PageStorage widget along with PageStorageBucket, which acts as a key value persistent layer.

    Go through this article for a beautiful explanation -> https://steemit.com/utopian-io/@tensor/persisting-user-interface-state-and-building-bottom-navigation-bars-in-dart-s-flutter-framework

提交回复
热议问题