The Form widget is used with the companion of a key of the FormState type that contains helpers to manage all of the children of its FormField instances:
final _key = GlobalKey<FormFieldState<String>>();
...
Form(
key: _key,
child: Column(
children: <Widget>[
TextFormField(),
TextFormField(),
],
),
);
Then, we can use the key to retrieve the Form associated state and call its validation with _key.currentState.validate(). Now, let's have a look at the second option.