removeAllByCallback method

void removeAllByCallback (
  1. EventCallback callback
)

Remove all listeners which matches with the callback provided. It is possible to register for multiple events with a single callback. This mechanism ensure that all event registrations would be cancelled which matches the callback. callback - The event callback used during subscription.

Implementation

void removeAllByCallback(EventCallback callback) {
  if (null == callback) {
    throw ArgumentError.notNull("callback");
  }
  this._listeners.forEach((key, lst) {
    lst.removeWhere((item) => item?.callback == callback);
  });
}