September 2019
Beginner
512 pages
12h 52m
English
If we are using the TextFormField widget, things get simpler:
final _key = GlobalKey<FormFieldState<String>>();...TextFormField( key: _key,);
We can add a key to our TextFormField that later can be used to access the widget's current state through the key.currentState value, which will contain the updated value of the field.
The specialized type of key refers to the kind of data the input field works with. In the preceding example this is String, because it is a TextField widget, so the key depends on the particular widget used.
The FormFieldState<String> class also provides other useful methods and properties to deal with FormField:
Read now
Unlock full access