validate method

bool validate()

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();
  }
  errorText = validator?.call(value);
  return errorText == null;
}