off method

void off(
  1. EventType event,
  2. void listener(
    1. dynamic
    )
)

Stops listening to the events.

Implementation

void off(EventType event, void Function(dynamic) listener) {
  if (_listeners.containsKey(event)) {
    _listeners[event]?.removeWhere((entry) {
      if (entry.key == listener) {
        entry.value.cancel();
        return true;
      }
      return false;
    });
  }
}