reset method

void reset()

Resets the form field to its FormField.initialValue and clears any active errors.

Implementation

void reset() {
  if (!mounted) {
    widget.value = widget.initialValue;
    widget.errorText = null;
    widget.touched = false;
    return;
  }
  setState(() {
    widget.value = widget.initialValue;
    widget.errorText = null;
    widget.touched = false;
  });
}