validateForm method

bool validateForm({
  1. bool clear = false,
  2. bool consumeError = true,
})

Implementation

bool validateForm({bool clear = false, bool consumeError = true}) {
  if (clear) {
    errors.clear();
    remainingError.clear();
  }
  this.consumeError = consumeError;
  return formKey.currentState?.validate() ?? false;
}