EventAggregator class abstract

Event Aggregator Used to propagate app specific events through out the App. Widgets, State and/or Services can consume the events published.

Specific type of event can be subscribed with: eventAggregator.subscribe<IntEventA>() If no type is provided, the subscriber gets all the events.

Example:

class IntEvent {
  final int value;
  IntEvent(this.value);
}

final ea = EventAggregator();

ea.subscribe<IntEventA>().listen((event) {
  print(event.value);
})

ea.publish(IntEvent(1));
ea.publish(ArbitraryEvent());

The above code prints 1 cause of the first event, and the listener doesn't receive ArbitraryEvent()

Implemented types
Implementers

Constructors

EventAggregator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish<T>(T event) → void
subscribe<T>() Stream<T>
toString() String
A string representation of this object.
inherited

Operators

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