addError method Null safety

void addError(
  1. Object error,
  2. [StackTrace? stackTrace]
)

Implementation

void addError(Object error, [StackTrace? stackTrace]) {
  assert(!isClosed, 'You cannot add error to closed Stream');
  _notifyError(error, stackTrace);
}