Skip to content
pubscout

async_events

1.4.0, released 3 weeks ago by an unverified publisher

A portable asynchronous event hub supporting multiple storage types.

WASM-readyUnverified publisher
$ flutter pub add async_events
Source repository

What it does

Provides an asynchronous event hub with channels to submit, subscribe to, and persist events using different storage backends. Supports event replay from the beginning of channels and configurable polling.

AI-written summary of version 1.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need an event hub or pub-sub mechanism with persistent storage support in Dart.
  • You want to replay historical events when subscribing to a channel.

Skip it when

  • You need complex state management libraries like BLoC or Riverpod for UI widget rebuilding.
  • You do not require event persistence or channels.

Strengths

  • Supports multiple storage types for events.
  • Allows replaying past events on subscription using fromBegin: true.
  • Portable and works across Dart and Flutter platforms.

Weaknesses

  • Limited documentation beyond the basic example in the README.
  • Requires reflection_factory and code generation setup.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
4

Requires code generation via build_runner due to the reflection_factory dependency.

import 'package:async_events/async_events.dart';

void main() async {
  var storage = AsyncEventStorageMemory('test');
  var hub = AsyncEventHub('test', storage);
  var c1 = hub.channel('c1');
  var sub1 = await c1.subscribe((event) {
    print('C1 EVENT> $event');
  });
  await c1.submit('t', {'name': 't1'});
  sub1.cancel();
}

Alternatives

Packages that do the same job and could replace async_events.

Works with

Packages commonly used together with async_events: ones it builds on, ones built on it, and its own family.