flutter_fit_events 1.0.2 copy "flutter_fit_events: ^1.0.2" to clipboard
flutter_fit_events: ^1.0.2 copied to clipboard

A flutter package that handles listening and publishing events throughout your app.

A flutter package that handles listening and publishing events throughout your app, with the observer pattern.

Features #

  • Publish events
  • Listen to all events
  • Listen to specific types of events

Getting started #

  • Go inside your pubspec.yaml file
  • Add this line under the dependencies:
flutter_fit_events: ^1.0.2
  • Get dependencies
flutter pub get

Usage #

First, AppEventsDispatcher is a Singleton, so you can use it easily everywhere.

  1. Send an event for dispatch with AppEventsDispatcher().publish(event)
  2. Listen to all events with AppEventsDispatcher().stream.listen((AppEvent event) {})
  3. Listen to a specific type of event with AppEventsDispatcher().listenTo<AppEventType>((AppEvent event) {})

Additional information #

Inspired from this article. Feel free to give any feedback ! This package is also open to contributions.

4
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package that handles listening and publishing events throughout your app.

Homepage
Repository (GitHub)
View/report issues

Topics

#events #dispatcher #observer

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_fit_events