off method
This function attempts to unbind the handler
from the event
Implementation
void off(String event, [EventHandler? handler]) {
if (handler != null) {
this._events[event]?.remove(handler);
this._eventsOnce[event]?.remove(handler);
if (this._events[event]?.isEmpty == true) {
this._events.remove(event);
}
if (this._eventsOnce[event]?.isEmpty == true) {
this._eventsOnce.remove(event);
}
} else {
this._events.remove(event);
this._eventsOnce.remove(event);
}
}