unregister<TEvent> method

void unregister<TEvent>(
  1. EventHandler<TEvent> handler
)

Unregisters the given handler.

Implementation

void unregister<TEvent>(EventHandler<TEvent> handler) {
  final handlers = _getHandlersFor<TEvent>();

  assert(
    handlers.contains(handler),
    'unregister<$TEvent> was called for a handler that was never registered',
  );

  handlers.remove(handler);
}