validate method

bool validate({
  1. bool notify = true,
})

Implementation

bool validate({bool notify = true}) {
  clearError(notify: notify);
  if (!canValidate) return true;
  for (ValidationController validation in validations) {
    if (!(validation.isValid?.call(controller: this) ?? true)) {
      setError(validation.message, notify: notify);
      return false;
    }
  }
  return true;
}