validate method

List<FormError> validate()

Validates your form. Returns a list of form errors, or an empty list if there are no errors - in which case isValid will be true. Validation is handled lazily so you'll need to call this function to trigger validation.

Implementation

List<FormError> validate() {
  final errors = validator();

  if (errors.isNotEmpty) {
    _isValid = false;
  } else {
    _isValid = true;
  }

  return errors;
}