addError method

  1. @override
void addError(
  1. Object o, [
  2. StackTrace? st
])
override

As with add, but for adding errors.

Implementation

@override
void addError(Object o, [StackTrace? st]) {
  _lastAddedValue = ValueOrException.exc(o, st);
  if (!_sync && _controller.hasListener) {
    if (_controllerAddScheduled) return;
    _controllerAddScheduled = true;
    scheduleMicrotask(_controllerAddMicrotask);
  } else {
    _controllerAddMicrotask();
  }
}