removeAllByEvent method Null safety

void removeAllByEvent(
  1. String event
)

Use this mechanism to remove all subscription for a particular event. Caution : This will remove all the listeners from multiple files or classes or modules. Think twice before calling this API and make sure you know what you are doing!!! event - Event name used during subscription.

Implementation

void removeAllByEvent(String event) {
  if (event.trim().isEmpty) {
    throw ArgumentError.notNull('event');
  }
  _listeners.removeWhere((key, val) => key == event);
}