close method

  1. @override
void close()
override

Closes the sink.

Calling this method more than once is allowed, but does nothing.

Neither add nor addError must be called after this method.

Implementation

@override
void close() {
  if (_subscriptions != null) {
    var listeners = _subscriptions!;
    // This will cause an exception to be thrown if a listener is added while
    // closing subscriptions.
    _subscriptions = null;
    for (int i = 0; i < listeners.length; i++) {
      listeners[i]._closeSubscription();
    }
  }
}