async_switcher 1.0.0 copy "async_switcher: ^1.0.0" to clipboard
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_switcher package
  • AsyncValue<T> sealed class hierarchy with AsyncLoading, AsyncData, AsyncEmpty, and AsyncError states
  • StateWrapper<T> widget for automatic UI switching based on async state
  • Support for Future<T> via StateWrapper.fromFuture() constructor
  • Support for Stream<T> via StateWrapper.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
1
likes
150
points
73
downloads

Publisher

unverified uploader

Weekly Downloads

A smart Flutter widget that automatically switches UI based on async state (loading → empty → error → data). Framework-independent, supports Future & Stream.

Homepage
Repository (GitLab)
View/report issues

Topics

#flutter #widget #async #state-management #ui

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on async_switcher