removeListener method

void removeListener(
  1. SubscriptionListener listener
)

Removes a listener from the Subscription instance so that it will not receive events anymore.

Lifecycle a listener can be removed at any time.

Implementation

void removeListener(SubscriptionListener listener) {
  var found = _listeners.remove(listener);
  if (found) {
    scheduleMicrotask(() {
      listener.onListenEnd();
    });
  }
}