flutter_query_client 1.1.0
flutter_query_client: ^1.1.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.1.0 #
Fixes #
- Fixed race condition in
InfiniteQueryController._executeFirstPagecache-hit branch — missing_filterVersioncheck afterawait Future.delayed(Duration.zero)could cause stale filter data to be emitted ifsetParamswas called concurrently - Fixed race condition in
InfiniteQueryController._executeFirstPagepause branch — same missing version check allowed apausedstate emit to overwrite state set by a concurrentsetParamscall - Fixed
InfiniteQueryController.loadMorenot calling_startRefetchInterval()on success — polling would never start ifloadMorewas the first successful fetch operation
1.0.1 #
Fixes #
- Removed unnecessary
package:meta/meta.dartimport fromQueryControllerandInfiniteQueryController— elements are already available viapackage:flutter/foundation.dart - Removed
@internalannotation fromhandleRemount()in both controllers - Fixed unresolved dartdoc references in
QueryLoggerandRefetchOnMount— replaced[Logger.root.onRecord]and[staleTime]with backtick code spans
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