async_events
1.4.0, released 3 weeks ago by an unverified publisher
A portable asynchronous event hub supporting multiple storage types.
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.
- snowplow_tracker
Flutter package for sending Snowplow analytics events on Android, iOS, and Web.
78Compare - result_type
A Result type representing success or failure in Dart
50Compare - events_emitter
An intuitive event-based system inspired by NodeJS's Event Emitter with type safety.
55Compare - common_utils2
Production-focused Flutter utilities for notifications, storage, connectivity, and media.
55Compare
Works with
Packages commonly used together with async_events: ones it builds on, ones built on it, and its own family.
- loggingasync_events depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- async_extensionasync_events depends on itDart async extensions for Future, FutureOr, and performance improvements.
- reflection_factoryasync_events depends on itAllows Dart reflection and method proxies using code generation across all platforms.
- bones_apiBuilt on async_eventsA powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.