flutter_api_state 0.0.9
flutter_api_state: ^0.0.9 copied to clipboard
A Flutter package that simplifies async UI state handling (loading, success, error, empty) with built-in retry and pull-to-refresh support.
0.0.9 #
- Fix:
enablePullToRefresh: trueinside an unbounded vertical parent (e.g.SingleChildScrollView+ColumnwithoutExpanded) silently rendered nothing because the innerListViewasserted on unbounded height. The widget now detects unbounded constraints, skips theRefreshIndicatorwrap, logs a debug warning explaining the fix, and still renders the current state.
0.0.8 #
- Fix: error / no-network states with
enableRetry: truenow lay out correctly even when the parent provides unbounded vertical constraints (e.g. inside aSingleChildScrollView/Column). The retry column no longer usesFlexible; it sizes to its children.
0.0.7 #
- Improve pub.dev platform-support score by switching the network checker
to the canonical three-file conditional-import pattern (stub +
dart:io- web). Behaviour is unchanged:
dart:ioDNS lookup on Android / iOS / Linux / macOS / Windows, no-op on web, sensible default when the platform can't be determined statically.
- web). Behaviour is unchanged:
0.0.6 #
- Fix: "Null check operator used on a null value" crash when the no-network
(or error) branch rendered with
enablePullToRefresh: trueandenableRetry: true. The pull-to-refresh scrollable shell now bounds its child to the viewport height so the innerColumn+Flexible/MainAxisAlignment.centerlay out correctly.
0.0.3 #
- New: optional pre-flight connectivity check. Set
enableNetworkCheck: trueto skip the future when offline and show thenoNetworkwidget instead. Default check usesdart:ioDNS lookup on mobile/desktop; web is a no-op. Override viahasNetwork: () async => ...to plug inconnectivity_plusor your own logic. Works withenableRetry(tap to recheck) andenablePullToRefresh.
0.0.2 #
- Fix:
enablePullToRefresh: truecrashed with "RenderBox was not laid out" when the success child was an already-scrollable widget (e.g.ListView.builder). The widget no longer wraps scrollable children in aSingleChildScrollView; non-scrollable error/empty branches are wrapped in aListViewso pull still works.
0.0.1 #
- Initial release of
flutter_api_state. ApiStateBuilder<T>with loading / error / empty / success branches.EmptyDetectorfor null / empty list / map / set / string detection.- Built-in retry button (
enableRetry, optionalretryButtonBuilder). - Built-in pull-to-refresh (
enablePullToRefresh).