flutter_eventemitter2 1.0.0 copy "flutter_eventemitter2: ^1.0.0" to clipboard
flutter_eventemitter2: ^1.0.0 copied to clipboard

Dependency free publish/subscribe(pub/sub) for dart&flutter.

eventemitter #

Dependency free publish/subscribe(pub/sub) for dart&flutter.

How to use #

Open the pubspec.yaml file, and add eventemitter: unde dependencies:

  dependencies:
    flutter:
      sdk: flutter
    # ...
    # ...
    eventemitter: ^0.1.3

install it from terminal: Run flutter packages get

Example #

String token = EventEmitter.subscribe('topic', (data) {
  // receive 2
  print(data);
});

// publish is async function
EventEmitter.publish('topic', 1)
EventEmitter.publishSync('topic', 2)
EventEmitter.unsubscribe(token);

0
likes
130
pub points
85%
popularity

Publisher

unverified uploader

Dependency free publish/subscribe(pub/sub) for dart&flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_eventemitter2