I am using HydratedMixin to restore the last state after routing. The idea is cool :))
There is a problem that the state is restored after building the widgets, which in some cases leads to problems (see the code below)
For example,
we use the CupertinoTextFormFieldRow widget as part of the CupertinoFormSection. It has an initialValue property (default value on first build).
When the state is restored, it happens so that initialValue = null, and then after a while initialValue = valueFromPrefs. But since the first construction has already been (an element with a state has been created), the second initialValue is no longer taken into account
Hi!
I am using HydratedMixin to restore the last state after routing. The idea is cool :))
There is a problem that the state is restored after building the widgets, which in some cases leads to problems (see the code below)
For example, we use the
CupertinoTextFormFieldRow
widget as part of theCupertinoFormSection
. It has aninitialValue
property (default value on first build).When the state is restored, it happens so that
initialValue = null
, and then after a whileinitialValue = valueFromPrefs
. But since the first construction has already been (an element with a state has been created), the secondinitialValue
is no longer taken into accountPage
Store
State
Is there some way to wait for the store to be restored before the first build? What other solutions could there be?