removeListener method
Unsubscribe from getting any future events from emitter. This mechanism uses event name and callback to unsubscribe from all possible events.
Implementation
void removeListener(String eventName, EventCallback callback) {
if (null == eventName || eventName.trim().length == 0) {
throw ArgumentError.notNull("eventName");
}
if (null == callback) {
throw ArgumentError.notNull("callback");
}
// Check if listeners have the specific event already registered.
// if so, then check for the callback registration.
if (this._listeners.containsKey(eventName)) {
List<Listener> subs = this._listeners[eventName];
subs.removeWhere((element) =>
element?.eventName == eventName && element?.callback == callback);
}
}