broadcast_bus 0.0.2
broadcast_bus: ^0.0.2

Flutter Android iOS web

A new Flutter package project.

broadcast_bus #

Broadcast bus defines a global bus that can be used across your application, completly context free.

Internally, it uses a Stream of String, supporting multiple listeners.

Usage #

It is possible to emit a new value on the bus using:

BroadcastBus().emit('event');

and listening for events (or a specific event):


BroadcastBus().getMainBus().listen((event) { 
    // check the event and react
})

...

BroadcastBus().getFilteredBus('specific event').listen((_) {
    //react to the event
}