I am looking for the best way of implementing event system in dart. My requirements are:
- I want to know event arguments when sending/listening events (nice to have code completion).
- Should be quite fast.
- Events may be global (I don't need the object-event connection).
It seems that using the streams is good way to go, but how to structure whole manager? I was thinking about something like:
class EventManager {
Stream<Message1> onMessage1;
Stream<Message2> onMessage2;
Stream<Message3> onMessage3;
(...)
}
but my intuition tells me that is rather bad way. Any advice?