Skip to content

How can is reset specific field inside a form? #746

Closed Answered by danvick
amirgc asked this question in Q&A
Discussion options

You must be logged in to vote

You can always add a key to the field then use it to reset the field. Like so:

// Create key
final _fieldKey = GlobalKey<FormBuilderFieldState>();
...

FormBuilderDropdown(
  // Add key to field widget
  key: _fieldKey,
  ...
)

...

// Reset field using key
_fieldKey.currentState.reset();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danvick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants