removeListener method

void removeListener(
  1. MpnSubscriptionListener listener
)

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

Lifecycle A listener can be removed at any time.

Implementation

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