Access the same state from different Screen
wtoalabi opened this issue · 1 comments
Shout out to @brianegan and all contributors to this amazing package!
I have enjoyed my foray into this so far!
However, I am stuck at this point.
What I want to do is, whenever I navigate to the secondscreen, I want to maintain the same state, that was set from the first screen.
Currently at the root of my first screen I have ScopedModel, but I when I tried to access ScopedModelDescendant from the second screen, it says "Could not find the correct ScopeModel".
But when I tried to give the second screen its own ScopeModel from its root, the incoming state is lost.
I guess what I need is how to share state across several screens after navigation!
Thanks!
Oh!
Sorry for bothering y'all.
I finally figured it out.
My mistake was I imported ScopedModel on the first page, then expect the second screen to have access to that state, when it didnt inherit from the first screen.
It is simply a sibling.
So, what I did to get the desired result was to move ScopedModel to the root of all the widgets.
Duh!
Dumb right?