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.


void removeAllByCallback(EventCallback callback) {
  _listeners.forEach((key, lst) {
    lst.removeWhere((item) => item.callback == callback);