API Reference 0.7.1rikulo_eventBroadcaster

Broadcaster abstract class

The broadcaster used to broadcast events.

The bradcasted event will be sent to every root views if they are mounted (i.e., inDocument). Thus, to listen a broadcast event, you can register a listenber to either broadcaster or one of the moutned root views.

abstract class Broadcaster implements StreamTarget<ViewEvent> {
 /** Returns [BroadcastEvents] for adding or removing event listeners.
  */
 BroadcastEvents get on;
 /** Broadcasts an event to all registered listeners.
  */
 bool sendEvent(ViewEvent event, {String type});
 /** Posts an event to all registered listeners.
  * Unlike [sendEvent], [postEvent] puts the event in a queue and returns
  * immediately. The event will be handled later.
  */
 void postEvent(ViewEvent event, {String type});
}

Implements

StreamTarget<ViewEvent>

Properties

final BroadcastEvents on #

Returns BroadcastEvents for adding or removing event listeners.

BroadcastEvents get on;

Methods

abstract void addEventListener(String type, void listener(T event)) #

inherited from StreamTarget

Adds an event listener.

abstract void postEvent(ViewEvent event, {String type}) #

Posts an event to all registered listeners. Unlike sendEvent, postEvent puts the event in a queue and returns immediately. The event will be handled later.

abstract void removeEventListener(String type, void listener(T event)) #

inherited from StreamTarget

Removes an event listener.

abstract bool sendEvent(ViewEvent event, {String type}) #

Broadcasts an event to all registered listeners.