notification_dispatcher 0.3.1 copy "notification_dispatcher: ^0.3.1" to clipboard
notification_dispatcher: ^0.3.1 copied to clipboard

retracted

Inspired by Apple's NotificationCenter. Passes information around to registered observers.

example/notification_dispatcher_example.dart

import 'package:notification_dispatcher/notification_dispatcher.dart';

class YourClass {
  int count = 0;

  void init() {
    NotificationDispatcher.instance.addObserver(
      this,
      name: 'observerName',
      callback: (_) => count++,
    );
  }
}

void main() {
  final yourClass = YourClass()..init();
  NotificationDispatcher.instance.post(name: 'observerName');

  print(yourClass.count); // 1
}
4
likes
0
pub points
25%
popularity

Publisher

unverified uploader

Inspired by Apple's NotificationCenter. Passes information around to registered observers.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on notification_dispatcher