on method
set a callback for events of this type.
REMEMBER TO DISPOSE INSTANCES OF THIS CLASS OR CANCEL THESE CALLBACKS
i.e. call EventEmitter.dispose
Use the special event
name of 'all' to fire this callback on all events.
Implementation
ProEventObserver on(String event, void Function(ProEvent<T> event) callback) {
if (!callbacks.containsKey(event)) callbacks[event] = [];
callbacks[event]!.add(callback);
return ProEventObserver(() => callbacks[event]?.remove(callback));
}