EventBus class

Allow widgets to communicate to each other without direct coupling

Constructors

EventBus({bool sync: false})
Create an event bus with default dart StreamController. You can use sync to indentify whether the event bus should be sync or async, by default it is async. For more detail, check Stream document.
EventBus.customController(StreamController _streamController)
User customer stream controller in event bus. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

dispose() → void
Shutdown the internal stream conroller. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
publish(dynamic event) → void
Publish an event to all corresponding responders via EventBus
respond<T>(Responder<T> responder) Subscription
Subscribe Eventbus on a specific type of event, and register responder to it. [...]
toString() String
Returns a string representation of this object.
inherited

Operators

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

Static Methods

of(BuildContext context) EventBus
Try to find EventBus provided by an ancestor EventBusWidget
publishTo(BuildContext context, dynamic event) → void
An convenient call to publish event via the EventBus provided by an ancestor EventBusWidget [...]