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
Losing state on hot reload or otherwise triggered rebuild of entire app #193
Comments
The solution is to move your class MyApp extends StatelessWidget {
final _routerDelegate = BeamerRouterDelegate(
locationBuilder: ...
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routeInformationParser: BeamerRouteInformationParser(),
routerDelegate: _routerDelegate,
...
);
}
} |
Hi @slovnicki In your opinion, is it okay if I want to add more locations at runtime, like enabling some features by activating an option in the settings? I also encountered the same issue with you, even tested with example from beamer packages. |
Sorry for late response @lam-nv, haven't notice this here. Yes, I think this should be fine. |
Beware that #193 (comment) will not help if you're on web and flutter |
This comment has been minimized.
This comment has been minimized.
Hi @oyont |
My flutter version is 2.2.0 but I'm running the app on web. It's happening on mobile too |
This is in README so I'll close |
Just curious about this issue of losing state on rebuild :
Conclusion |
Hi @okelloEnos |
Can be this thread reopened? I've the same issue but moving BeamerDelegate to a final property does not work |
I'm also have this same issue |
same issue :( |
This issue is quite common. We should also add it to documentation as a tip.
The text was updated successfully, but these errors were encountered: