removeError method Null safety

void removeError(
  1. String key,
  2. {bool markAsDirty = false}
)

Removes an error given the error key.

If markAsDirty is true then the control is marked as dirty.

See dirty.

Implementation

void removeError(String key, {bool markAsDirty = false}) {
  _errors.removeWhere((errorKey, dynamic value) => errorKey == key);
  _updateControlsErrors();

  if (markAsDirty) {
    this.markAsDirty(emitEvent: false);
  }
}