rxbus 0.0.2

Flutter Android iOS web

A Flutter EventBus using RxDart

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)

1
likes
70
pub points
74%
popularity

A Flutter EventBus using RxDart

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

huclengyue@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, rxdart

More

Packages that depend on rxbus