validate method

bool validate()

Runs the validator and returns true if the field is valid.

Implementation

bool validate() {
  if (widget.validator != null) {
    _errorText = widget.validator!(_value);
  }
  setState(() {});
  return _errorText == null;
}