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