unregister<TEvent> method
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);
}