rome_bus 0.0.2 copy "rome_bus: ^0.0.2" to clipboard
rome_bus: ^0.0.2 copied to clipboard

EventBus for flutter & dart,for handling event,just use event_bus.

RomeBus #

Logo

A package for handling events,like EventBus in android,can use in dart project or flutter project.

Architecture #

architecture

Pub #

dependencies:
  rome_bus: ^0.0.2

Usage with 3 step #

1. Create an Event Object #


//event object
class CommonEvent {
  final int count;

  CommonEvent(this.count);
}

2. Register an Event #


String eventRegisterText ='';

 @override
  void initState() {
    super.initState();
    //just control event object
    RomeBus.getBus().register<CommonEvent>((event) {
      setState(() {
        eventRegisterText = 'register event ${event.count}';
      });
    });
  }

3. Send an Event #


RomeBus.getBus().send(CommonEvent(100));

Using Vip Event #

Sometimes you only need to listen to the event once, you can use VipEvent.

see example vip_page .

Screen #

architecture

License #

The MIT License (MIT)

0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

EventBus for flutter & dart,for handling event,just use event_bus.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on rome_bus