PersistentBottomNavBarV2 icon indicating copy to clipboard operation
PersistentBottomNavBarV2 copied to clipboard

Can we trigger navigator stack clearing when onItemSelected

Open dodatw opened this issue 3 years ago • 4 comments

It's very useful widget, thank you continus maintain on v2. I have a request, can we add a setting on PersistentTabView that we can trigger navigator stack clearing when onItemSelected. After trace code, it will trigger navigator stack clearing when tap selected tab again. Can we add a setting that can trigger directly?

dodatw avatar Aug 10 '22 05:08 dodatw

I saw a attribute popAllScreensOnTapOfSelectedTab. Is it possiable add another attibute that popAllScreensOnTap ? not only pop when selectedTab.

dodatw avatar Aug 15 '22 03:08 dodatw

So you want to have the original screen for each tab every time you navigate to that tab, right? In that case, you can set stateManagement: false. With that, the navigator history will not be remembered by the widget. Does that solve your need?

jb3rndt avatar Aug 16 '22 18:08 jb3rndt

@jb3rndt I tried it. the behavior very close what i need. But each page status will be reset when click tab. I need pop, but don't reset page.

Is it possiable add this flag?

dodatw avatar Aug 24 '22 10:08 dodatw

I think you need the same functionality as described here: #33. Here you can find a code snipped that could solve your issue: https://github.com/jb3rndt/PersistentBottomNavBarV2/issues/33#issuecomment-1146243930

jb3rndt avatar Aug 31 '22 14:08 jb3rndt