leulit_flutter_actionmanager 4.0.0
leulit_flutter_actionmanager: ^4.0.0 copied to clipboard
A lightweight, type-safe action dispatcher for Flutter applications. Works seamlessly across all layers - UI, domain, data, and services.
Changelog #
4.0.0 - 2026-02-10 #
🚨 BREAKING CHANGES #
- Removed
streamOf<T>()method - UseActionManager.stream.where((a) => a.action == yourAction)instead for filtering streams by action
✨ Improvements #
- Simplified dispatch logic - Removed internal complexity while maintaining all functionality
- More predictable stream behavior - Stream always emits events even without registered handlers
- Better code maintainability - Cleaner, more straightforward implementation
Migration Guide #
If you were using streamOf<T>():
Before:
final subscription = ActionManager.streamOf<String>(AppAction.test)
.listen((action) {
print(action.data);
});
After:
final subscription = ActionManager.stream
.where((a) => a.action == AppAction.test)
.listen((action) {
print(action.data as String?);
});
Or simply use the higher-level listen() API:
final subscription = ActionManager.listen<String>(
AppAction.test,
(data) => print(data),
);
3.0.0 - 2026-02-09 #
🚨 BREAKING CHANGES #
- Renamed
Actionclass toActionEventto avoid naming conflicts with Flutter SDK's built-inActionclass - This change affects all code that directly instantiates or references the
Actionclass
Why This Change? #
The Flutter SDK includes a built-in Action class in package:flutter/src/widgets/actions.dart. Using a class with the same name in this package could cause naming conflicts and ambiguity in applications that use both Flutter's actions system and this action manager.
Migration Guide #
The ActionManager API remains unchanged. If you were only using the high-level API (ActionManager.dispatch, ActionManager.on, etc.), no changes are needed.
If you were directly instantiating or type-checking against the Action class:
Before:
final action = Action<String>.now(AppAction.test, data: 'test');
if (myVar is Action<String>) { ... }
After:
final action = ActionEvent<String>.now(AppAction.test, data: 'test');
if (myVar is ActionEvent<String>) { ... }
Changed #
- Renamed
Action<T>class toActionEvent<T> - Updated
FullActionHandler<T>typedef to useActionEvent<T> - Updated internal references in
ActionManagerandActionLogger - Updated all tests (48 tests passing)
- Updated documentation and examples
- No analysis issues
Fixed #
- Eliminated potential naming conflicts with Flutter SDK's
Actionclass - Improved clarity and semantic meaning of the action event class
2.0.0 - 2026-02-09 #
🚨 BREAKING CHANGES #
- Renamed
ActionDispatchertoActionManagerto avoid naming conflicts with Flutter's built-inActionDispatcherclass - Renamed file
action_dispatcher.darttoaction_manager.dart
Migration Guide #
Simply replace all instances of ActionDispatcher with ActionManager in your code:
Before:
ActionDispatcher.dispatch(AppAction.test);
ActionDispatcher.on<String>(AppAction.test, (data) {});
After:
ActionManager.dispatch(AppAction.test);
ActionManager.on<String>(AppAction.test, (data) {});
Changed #
- All
ActionDispatcherreferences updated toActionManagerthroughout the library - Updated all documentation (README.md, project.md)
- Updated all examples and tests
- All 48 tests passing
- No analysis issues
1.0.2 - 2026-02-09 #
Added #
- Comprehensive test suite with 48 tests covering all library methods
- Tests for Action class (creation, equality, hashCode, toString)
- Tests for ActionDispatcher dispatch, registration, and unregistration
- Tests for reactive streams (listen, stream, streamOf)
- Tests for metadata and statistics tracking
- Tests for error handling and resilience
- Tests for ActionLogger configuration
- Integration tests for complex workflows
Improved #
- Enhanced code formatting across all files
- Better test coverage and reliability
- Improved documentation in test files
1.0.0 - 2026-02-09 #
Added #
- Initial release
- Core ActionDispatcher with enum-based actions
- Type-safe action handlers
- Built-in debugging and introspection
- Reactive StreamSubscription support
- Comprehensive documentation and examples
- Unit tests with full coverage
- Example application demonstrating key features