add method

void add (T event)
override

Adds data to the sink.

Must not be called after a call to close.

Implementation

void add(T event) {
  if (_isClosed) {
    throw new StateError("Can't add to a closed sink.");
  }

  _events.add(event);
}