validate method
Runs the validator callback against the current field value. Updates errorText and returns whether the field is valid.
Implementation
bool validate() {
if (_state != null) {
return _state!.validate();
}
if (validator != null) {
errorText = validator!(value);
} else {
errorText = null;
}
return errorText == null;
}