unregister method
Unregisters a callback for the given event name.
Implementation
Future<void> unregister(String eventName, Function? callback) async {
if (_callbacks.containsKey(eventName)) {
var existed = _callbacks[eventName];
existed?.remove(callback);
_callbacks.remove(eventName);
_callbacks.putIfAbsent(eventName, () => existed);
}
_eventsSubscription?.resume();
}