简体   繁体   中英

How to reload a particular tab in bottom navigation bar flutter?

I have a bottom navigation bar with 5 tabs, In each tab I have a button that navigates to another separate screen using Navigation.pushNamed() (page 2); and from (page 2) I pop the screen, now the tab from where I navigated from need to be reloaded. because i store some data (page 2) and stored in sqflite i need to display the data in one of the tabs. Is it possible to reload a particular tab of a bottom navigation bar? I tried using Navigator.pop(context,true) that also didnt work. Can some one help me with this, thanks in advance.

this is done by the provider. I'm new to flutter as well but this guy explained it very well!

Flutter by default does not save state (and disposes the widgets). If you want to save the state of a tab, you can use a PageStorageBucket. It is really well described in this tutorial:

https://medium.com/@lucassaltoncardinali/keeping-state-with-the-bottom-navigation-bar-in-flutter-69e4168878e1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM