reset method

void reset()

Resets every FormField that is a descendant of this Form back to its FormField.initialValue.

The Form.onChanged callback will be called.

If the form's Form.autovalidateMode property is AutovalidateMode.always, the fields will all be revalidated after being reset.

Implementation

void reset() {
  for (final FormFieldState<dynamic> field in _fields) {
    field.reset();
  }
  _hasInteractedByUser = false;
  _fieldDidChange();
}