get_event_bus.dart

A minimal and scalable light-weight event bus library for get.dart

pub package license stars

Quick Start

No setup needed.

void main() {
  // fire a event
  Get.bus.fire(SomeClass());
  // listen a event
  Get.bus.on<SomeClass>((event) => Get.log(event), cancelOnError: true);
  // listen a event for once
  Get.bus.once<SomeClass>((event) => Get.log(event));
  // direct use of stream
  Get.bus.stream.listen((event) => Get.log(event), onData() => Get.log('onData'));
  // customized underlying stream
  Get.bus.streamController = PublishSubject();
  // independent use
  final bus = EventBus();
}

Feature

  • Minimal and scalable
  • Support get.dart
  • Support all platforms
  • 100% test coverage

Maintenance

  • Maintaining
  • Stable API

Examples

check out

Libraries

get_event_bus