FlutterRxBus

A Flutter EventBus using RxDart

Pub Package Pub Package

GitHub | Pub |

Usage

1. Add to pubspec.yaml

  rxbus: latest version

2. Define Event

Any Dart class or List or any Data can be used as an event.

class ChangeTitleEvent {
  String title;

  ChangeTitleEvent(this.title);
}

3. Register RxBus

Register RxBus

import 'package:rxbus/rx_bus.dart';

RxBus.singleton.register<ChangeTitleEvent>().listen((event) {
      ยทยทยท//do something
    print(event.title);
    });

4. Send Event

Register listeners for specific events:

 RxBus.singleton.post(ChangeTitleEvent("Changed by event"));

License

The MIT License (MIT)

Libraries

rxbus