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)

Libraries

bus
common_bus
rome_bus
rome_common_bus
rome_vip_bus
vip_bus