-
-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set the initial values of the fields #3
Comments
Hello @DinoSane, |
I created a simple project to ilustrate the problem git clone git@bitbucket.org:dinosane/form_builder.git thanks in advance. |
Please note that your string is fetched from SharedPreferences after the form is already built since the fetching is asyncronous. See code below and the corresponding console output: `class _FailingPageState extends State { @OverRide //Loading counter value on start @OverRide Console: I'd advise declaring the form within a |
You are correct! Using a FutureBuilder solve the problem. I though setting the value inside a setState was suffice, but as you pointed, it doesn't. |
I forgot to say: great job! :-) |
You're welcome @DinoSane. Thank you. Also note that you're not really required to use |
fix: respect initial value on field re-creation, from formbuilder
I've tried the simplest FormBuilder to read and write SharedPreferences.
TextFormField(initialValue: _name ) shows as it should
FormBuilderInput.textField(
type: FormBuilderInput.TYPE_TEXT,
attribute: "name",
value: _name,
label: "Name:",
)
Does not!
The text was updated successfully, but these errors were encountered: