Is state persisted when navigating to a new view in Stacked's web implementation? #934
Unanswered
CordMemescape
asked this question in
Q&A
Replies: 1 comment
-
Hey @CordMemescape I haven't experienced this yet, but I also haven't used long lived values throughout the app in any of my recent projects. I don't quite know why this is happening. Do you have a small example you can post here that I can try out and see what's happening. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Being a long-time user of Stacked, I do all my service initialisation in the
StartupViewModel
and get everything ready for the app.However, being quite new to using Flutter web with Stacked, I'm now wondering whether the same paradigm can be followed. I've noticed that even though I do the initialisation in the
StartupViewModel
as usual, when it comes time to using the initialised services, they're no longer initialised.In fact, I've also noticed that if I set up variables or services in any ViewModel's
onViewModelReady
, when I access them later from the ViewModel, they're also uninitialised.It seems that state isn't really preserved across Views or even within the View itself. Has anyone else experienced this or have any thoughts about it?
Beta Was this translation helpful? Give feedback.
All reactions