EventBus class

Allow widgets to communicate to each other without direct coupling


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. [...]


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


dispose() → void
Shutdown the internal stream conroller. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
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
A string representation of this object. [...]


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

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 [...]