flutter_query_client 1.0.0
flutter_query_client: ^1.0.0 copied to clipboard
A TanStack Query-inspired server state management library for Flutter. Handles caching, background refetching, pagination, mutations, and network-aware fetching out of the box.
1.0.0 #
Initial stable release.
Features #
- QueryController — fetch and cache server data with automatic stale-while-revalidate, retry with exponential backoff, refetch on mount, and refetch on reconnect
- MutationController — user-triggered mutations with lifecycle hooks (
onSuccess,onMutationError,onSettled) and optimistic cache update support - InfiniteQueryController — paginated / infinite-scroll queries with
loadMore(),hasMore, cursor or page-number pagination, and item-level cache helpers (updateItem,removeItem,appendItem,prependItem) - QueryClient — singleton two-level cache (
baseKey+ serialized params) with stale-time tracking, garbage collection, and active observer registry - QueryClientProvider —
InheritedWidgetfor injectingQueryClientand globalQueryDefaultsinto the widget tree - QueryProvider / InfiniteQueryProvider —
StatefulWidgetwrappers with remount detection viaTickerModeforIndexedStackandVisibilitysupport - QueryBuilder / InfiniteQueryBuilder — reactive builders that rebuild on state changes
- QueryListener / MultiQueryListener — side-effect widgets that respond to success and error without rebuilding the tree
- QueryState — Freezed-based immutable state with
status,fetchStatus,isStale, and convenience getters - NetworkConnectivityObserver — true L7 connectivity verification (HTTP HEAD), debounced events (500ms), lazy initialization
- QueryDefaults — global configuration for stale time, gc time, retry count, retry delay, refetch interval, network mode, error transform, and logging
- QueryLogger — opt-in structured logging with customizable handlers