NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1709 most downloaded on pub.dev
An intuitive Event-based system, inspired by NodeJS's Event Emitter. Allows for multiple data types with type safety events. Based on JavaScript and suitable for Dart and Flutter.
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 3 weeks to 2.4 years
Nearly every release is documented
notes for 23 of 23 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
23 releases · first in 2022
Dart SDK constraint updated from <3.0.0 to <4.0.0
[!] Changed:
<3.0.0 to <4.0.0rxdart updated from 0.27.5 to 0.28.0RestrictedEventEmitter for better control by allowing or disallowing specific event types, and the max listeners limit.
Added:
ListCallback.args1() to get the first argument of the list in a callback, added for consistencyChanged:
.emit() is optional, if no data is given the event will be of type Event<Null> which can still be caught by EventCallback<dynamic>Fixed:
lint developer dependency with lintsOne column per quarter.
ListCallback, a helper class that when appended on .on() lets you have multiple arguments. Essentially splitting a list event Event > into arguments,
Added:
.on() lets you have multiple arguments.
Essentially splitting a list event Event<List<dynamic>> into arguments,
it's a workaround for the fact that Dart can't handle spread syntax. See [ListCallback] documentation.Redundant listener reference of itself, in EventListener callbacks: onAdd, onRemove, onCall and onCancel. For simplicity and to avoid dynamic listener
[!] Removed:
listener reference of itself, in EventListener callbacks: onAdd, onRemove, onCall and onCancel. For simplicity and to avoid dynamic listener's type issues. Use this if possible, or a reference of the listener instead.Fixed:
EventListener property dataType
Added:
dataTypeFixed:
dynamic dataStreamEventListener, it's useful for having a streaming alternative to the default EventEmitter class
Added:
Fixed:
topic namingcancelAdded parameter to EventListener, tells the listener to automatically remove itself from the added EventEmitter when the .cancel() method is cal
Added:
cancelAdded parameter to EventListener, tells the listener to automatically remove itself from the added EventEmitter when the .cancel() method is called. This is used in case you want to add your own canceling method. It essentially appends callbacks to the onCancel callbacks.
.appendCallback() method to EventListener
[!] Changed:
Fixed:
lint dependency moved to developer dependencyrxdart dependency updated from 0.27.3 to 0.27.5
Changed:
rxdart dependency updated from 0.27.3 to 0.27.5Fixed:
.off()[!] Positional parameters in .off() changed to named parameters, as it was intendedEventListener properties once and protected added
Added:
once and protected addedonAdd, onRemove and onCancel.on() can catch the data as well as the Event<T> of the data[!] Changed:
[!] Removed:
stream, subscription and messageTypeMassive BREAKING CHANGES:
EventEmitter was refactored to not depend on Streams, which means it now manages the callbacks itself. The emitter can have more complex listener logic. Before it would depend on StreamEventEmitter.
File structure was changed to be more organized. This means you might need to update your imports.
Sync is no longer a thing in the EventEmitter, it's a StreamEventEmitter only thing now.
Other changes: [!]
Added: - shield.io badges Changed: - ChangeLog's format
Added:
shield.io badgesChanged:
.onAny in EventEmitter now returns an EventListener
Changed:
.onAny in EventEmitter now returns an EventListenerFixed:
Make package only dart dependant
Fixed:
dart dependant.emitEvent() emits an existing event, without having to create a new one
Added:
.emitEvent() emits an existing event, without having to create a new onerxdart package dependency, for better-implemented streams
Added:
rxdart package dependency, for better-implemented streamsFixed:
dynamic type would break unexpectedly.onAny return type (Still has errors)
Fixed:
.onAny return type (Still has errors)Changed: - Filter .onAny () by type Fixed: - pubspec.yaml clean up - Example with final
Changed:
.onAny<T>() by typeFixed:
pubspec.yaml clean upfinalonce in EventEmitter now returns a Future with the message, allowing to await (still needs a callback)
Changed:
once in EventEmitter now returns a Future with the message, allowing to await (still needs a callback)EventEmitter and EventStreamEmitter classes into different filesRemoved:
send for simplification, the same could be achieved with emitMore documentation (Why is this package different?)
Added:
Fixed:
Package description and documentation for type safety promotion
Changed:
Package dependency flutter_lints
Removed:
flutter_lintsStreamSubscription, cancel instances
Fixed:
on to return an EventListener, instead of a StreamSubscription
Changed:
on to return an EventListener, instead of a StreamSubscriptionFixed:
Initial release: EventEmitter
Initial release: EventEmitter
Your coding agent can read these notes before it upgrades. Set up the MCP server →