Closed kawi15 closed 3 weeks ago
You can try to use the onTabChanged
callback on PersistentTabView
to pop all screens on each tab that should not have state. If you really need to rebuild the StatefulWidget of the screen in each tab that should not maintain state, I dont think this package can offer you something so you need to find a solution in the flutter framework itself.
Can you post sample code how it should look like with onTabChanged
?
I tried to use Navigator.of(context).popUntil((route) => route.isFirst);
but it didn't work.
Ok, that was context
issue. I changed it to selectedTabContext
and it is working, thanks for suggestion.
I need to maintain state of one tab, when not really for all the others.
Is there possibility to do that with this package or there is any possible workaround?
I am using
BlocConsumer
under this tab, but when I setstateManagement
to false it's refreshing every time I open it.