You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that while I'm loading my form data from a repository, using futures/streams, I will still render my entire form, but wrapped in a Skeletonizer and populated with dummy data.
This causes a problem that all the form elements are hence first built with 'initialValue' of some irrelevent value (such as null). Then, when the future completes, and the form data is loaded - it rebuilds again and nothing really rebuilds - all the form elements are still empty.
One option is to build the form fields with some "magic" initialValue - however this is terrible, it will completely break the 'isDirty' flag.
What's the solution here?
I really need a way to force a Form Field to "re-initialize" once the form data goes from 'loading' to 'loaded'... ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using Skeletonizer:
https://pub.dev/packages/skeletonizer
This means that while I'm loading my form data from a repository, using futures/streams, I will still render my entire form, but wrapped in a Skeletonizer and populated with dummy data.
This causes a problem that all the form elements are hence first built with 'initialValue' of some irrelevent value (such as null). Then, when the future completes, and the form data is loaded - it rebuilds again and nothing really rebuilds - all the form elements are still empty.
One option is to build the form fields with some "magic" initialValue - however this is terrible, it will completely break the 'isDirty' flag.
What's the solution here?
I really need a way to force a Form Field to "re-initialize" once the form data goes from 'loading' to 'loaded'... ideas?
Beta Was this translation helpful? Give feedback.
All reactions