Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly use RouterOutlet with submodule without disposing #802

Open
fullflash opened this issue Nov 2, 2022 · 4 comments
Open
Labels
new New issue request attention

Comments

@fullflash
Copy link

fullflash commented Nov 2, 2022

Currently when use Modular.to.navigate BottomNavBarItem click it disposes Child Module that inside previous tab
we need to keep all modules undisposed because need each route in routerOutlet to keep his state and not dispose.
Need to keep tab pages state alive without disposing but without indexedstack

we are importing all routeoutlet modules in appmodule also with export true flag but it doesnt work with latest flutter_modular
as mentioned here https://github.com/Flutterando/modular/blob/e7cdfdb3935dc6b5e543b16a164ecf06c2e98446/doc/docs/flutter_modular/module.md

@fullflash fullflash added the new New issue request attention label Nov 2, 2022
@eduardoflorence
Copy link

For your scenario, ideally use PageView with WidgetModule

@allansrc
Copy link

you can set the useRootNavigator property to true to prevent the submodule's routes be disposed when you do a navigating to a different route “inside” the submodule.

@Vatalion
Copy link

Vatalion commented Dec 12, 2024

For your scenario, ideally use PageView with WidgetModule

@eduardoflorence any ideas for the current version? WidgetModule is deprecated.
Can't believe so many years and we still have this problem

@eduardoflorence
Copy link

@Vatalion, here is an example I made to create your own WidgetModule in current version:

#908 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue request attention
Projects
None yet
Development

No branches or pull requests

4 participants