off<T, P> method
Removes the callback
of event.
Implementation
void off<T, P>(
Object? instance,
Enum eventName,
CallbackEvent<T, P> callback,
) {
_oneOff<T, P>(instance, eventName, callback);
final _eventKey = _getEventKey(instance, eventName);
if (!(_events[_eventKey]?.contains(callback) ?? false)) {
return;
}
if (instance is ReactterNotifyManager) {
instance._removeListener();
}
_events[_eventKey]?.remove(callback);
if (_events[_eventKey]?.isEmpty ?? false) {
_events.remove(_eventKey);
}
}