clear method

void clear({
  1. bool clearErrors = false,
})

Clears the current message. Errors won't be cleared unless clearErrors is set.

Implementation

void clear({bool clearErrors = false}) {
  if (_hasError && !clearErrors) return;
  _hasError = false;
  message = null;
  notifyListeners();
}