My app depends (at least partially) on outside state (from the filesystem or settings). It's not that the user will update state on his own, it's just that when the app sets certain variable, it saves them to disk and when it's loaded, it reads them from disk.
As long as I don't navigate, everything works well (meaning that when I set state it is saved and when I restart the app the variables get restored). The problem is navigation - If I navigate a few screens in, change state, and then pop
back a few screens, and state won't update.
This is expected, as popping should return the screen back to where it was before.
But the problem is that unless I manually restore settings at every setState
, that variable isn't ever updated.
Is there a way to have pop
run a function (or method) to update certain variables on pop?
If I don't pop it's not a problem, as when I change state on the filesystem I c