Skip to content
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

How to set value of another field? #140

Closed
wyxcoder opened this issue Sep 22, 2019 · 5 comments
Closed

How to set value of another field? #140

wyxcoder opened this issue Sep 22, 2019 · 5 comments

Comments

@wyxcoder
Copy link

Seems didChange works for dropdown, but not TextField, looks like the code doesn't handle to set text on the controller

@mrsid96
Copy link

mrsid96 commented Oct 4, 2019

Any idea how to work on TextFields ?

@danvick
Copy link
Collaborator

danvick commented Oct 4, 2019

Hi @wyxcoder
Currently, this feature is not working so well. We can change the underlying value of a field using FormField.didChange but for most fields, the change won't propagate to the UI.

I'm planning to have this feature fully functional in the next major version (4.0.0) which will be an overhaul of the package.

@danvick
Copy link
Collaborator

danvick commented Oct 4, 2019

Any idea how to work on TextFields ?

For TextFields you could use a controller to update the field's value.

@mrsid96
Copy link

mrsid96 commented Oct 4, 2019

My use case is with FutureBuilder, and with FutureBuilder if I use setstate(), it just reloads, is there any other way i can set the value in TextField ?

@danvick
Copy link
Collaborator

danvick commented May 7, 2020

For a TextField, the best option is to use a TextEditingController to set its value programmatically.

@danvick danvick closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants