off method

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

Removes a listener for a specific event.

Implementation

void off(String event, Function(dynamic) listener) {
  _listeners[event]?.remove(listener);
  if (_listeners[event]?.isEmpty ?? false) {
    _listeners.remove(event);
  }
}