atomic_flutter 0.3.0
atomic_flutter: ^0.3.0 copied to clipboard
A lightweight, reactive state management solution for Flutter applications with async state support and domain-specific atoms.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2025-12-04 #
Fixed #
Critical Memory Leak Fixes:
- Fixed memory leaks in all core extension methods (
debounce,throttle,map,where,combine) - Fixed memory leaks in all async extension methods (
debounceAsync,mapAsync,chain,cached,asyncMap) - Fixed
StreamControllernot being disposed when atom is disposed inasStream() - All extension methods now properly cleanup listeners in both directions (source → derived and derived → source)
- Timer cleanup added to prevent resource leaks in debounce, throttle, and cached operations
Type Safety & Error Prevention:
- Computed atoms now throw
UnsupportedErrorwhen attempting to mutate viaset()orupdate() - Added circular dependency detection in
computed()with clear error messages - Prevents infinite loops from circular atom dependencies
Robustness & Error Handling:
- Listener errors are now caught and logged instead of crashing the app
- Errors in computed atom recomputation no longer prevent other listeners from executing
- Added try-catch blocks to all extension methods with error logging in debug mode
Edge Cases & API Improvements:
combineAsync()now handles empty list input (returns success with empty list)chain()now propagates initial state correctly (idle/loading/error states)combine()now includes error handling for tuple creation
Added #
- Comprehensive test suite with 31+ new test cases covering:
- Memory leak detection and prevention
- Computed atom mutation attempts
- Circular dependency detection
- Error handling in listeners and computed atoms
- Edge cases in async operations
- Bidirectional cleanup verification
Changed #
- All extension methods now use named listener functions for proper cleanup
- Improved documentation for
combineAsync()explaining behavior with empty lists - Enhanced error messages for computed atom mutations
0.2.3 - 2025-08-11 #
Fixed #
- Clean up whitespace in async widget and test files
- Update async handling and improve code structure
0.2.0 - 2025-08-11 #
Added #
- AsyncAtom: New async state management with
AsyncValue<T>wrapper - AsyncState enum:
idle,loading,success, anderrorstates - AsyncAtomBuilder: Widget for building UI based on async atom states
- AsyncBuilder: Simplified async widget with retry and refresh support
- Async Extensions:
debounceAsync()- Debounced async operationsmapAsync()- Transform async valuesexecuteIfNotLoading()- Conditional executionexecuteWithRetry()- Retry failed operations with exponential backoffchain()- Chain async operationscached()- Create cached async operations with TTLtoAsync()- Convert regular atoms to async atomsasyncMap()- Create async atoms from regular atom changes
- Global Async Functions:
computedAsync()- Create debounced computed async atomscombineAsync()- Combine multiple async atoms
- Memory Management: Enhanced automatic cleanup for async operations
- Debug Support: Extended debug utilities for async atoms
- Comprehensive Test Coverage: Added extensive tests for all new features
Changed #
- Enhanced core
Atomclass with improved async support - Updated extension methods with better async integration
- Improved documentation with async examples
Fixed #
- Async atom test stability improvements
- Memory leak prevention in async operations
0.1.1 - 2025-03-17 #
0.1.0 - 2025-03-17 #
Added #
- Initial beta release
- Core
Atomclass for state management computedfunction for derived state- UI widgets:
AtomBuilder,MultiAtomBuilder, andAtomSelector - Extension methods:
effect,asStream,select,debounce, andthrottle - Automatic memory management with reference counting
- Debug utilities for tracking atom state and changes
- Comprehensive documentation and examples