async_switcher 1.0.0
async_switcher: ^1.0.0 copied to clipboard
A smart Flutter widget that automatically switches UI based on async state (loading → empty → error → data). Framework-independent, supports Future & Stream.
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.
1.0.0 - 2025-12-09 #
Added #
- Initial release of
async_switcherpackage AsyncValue<T>sealed class hierarchy withAsyncLoading,AsyncData,AsyncEmpty, andAsyncErrorstatesStateWrapper<T>widget for automatic UI switching based on async state- Support for
Future<T>viaStateWrapper.fromFuture()constructor - Support for
Stream<T>viaStateWrapper.fromStream()constructor - Animated transitions between states (configurable)
- Automatic empty collection detection
- Custom empty detection predicate support
- Retry functionality for error states
- Default widgets:
DefaultLoadingWidget,DefaultEmptyWidget,DefaultErrorWidget - Comprehensive API documentation
- Complete example application
- Unit and widget tests
Features #
- Framework-independent: Works with any state management solution (Bloc, Riverpod, Provider, etc.)
- Type-safe: Uses sealed classes for exhaustive pattern matching
- Highly customizable: Custom widgets for each state
- Production-ready: Comprehensive error handling and edge cases covered