clearErrorMessages method

dynamic clearErrorMessages(
  1. String attribute
)

Clear error messages associated with a form attribute.

The clearErrorMessages function is used to remove any error messages associated with a specific form attribute. It removes the entry for the attribute from the _errors map, effectively clearing any error messages associated with it.

Parameters:

  • attribute: The identifier of the form attribute for which you want to clear error messages.

Implementation

clearErrorMessages(String attribute) {
  _errors.remove(attribute);
  getFormKey(attribute).currentState?.validate();
  _getErrorNotifier(attribute).value = getErrorMessages(attribute);
}