EventManager class

This class serves as a Typed event bus.

Events can be subscribed to by calling the "on" method.

Events are distributed by calling the "emit" method.

Subscribers my unsubscrive by calling "remove" with both the EventType and the callback function that was originally subscribed with.

Subscribers will implement a callback function taking exactly one argument of the same type as the Event they wish to receive.

Thus:

on(EventCallState(),(EventCallState event){ -- do something here });

Implementers

Constructors

EventManager()

Properties

hashCode int
The hash code for this object.
no setterinherited
listeners Map<Type, List>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAllEventHandlers(EventManager other) → void
add all event handlers from an other instance of EventManager to this one.
emit<T extends EventType>(T event) → void
send the supplied event to all of the listeners that are subscribed to that EventType
hasListeners(EventType event) bool
returns true if there are any listeners associated with the EventType for this instance of EventManager
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<T extends EventType>(T eventType, void listener(T event)) → void
call "on" to subscribe to events of a particular type
remove<T extends EventType>(T eventType, void listener(T event)?) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited