emit method
Trigger eventName
event with or without the param
given.
Implementation
void emit(
Object? instance,
Enum eventName, [
dynamic param,
]) {
final callbacks = {
...?_events[_getEventKey(instance, eventName)],
...?_events["${instance.hashCode}.${eventName.hashCode}"],
};
for (var callback in callbacks) {
callback(_getInstance(instance), param);
}
}