validate method
Triggers field validation using FormField.validator.
Updates widget.errorText, notifies listeners of state updates via setState, and returns whether the field is currently valid.
Implementation
bool validate() {
setState(() {
if (widget.validator != null) {
widget.errorText = widget.validator!(widget.value);
} else {
widget.errorText = null;
}
});
return widget.errorText == null;
}