Skip to content
pubscout

cached_query_flutter

3.4.1, released 3 weeks ago by cachedquery.dev

Widgets and addons for Cached Query in Flutter including query and mutation builders.

Rock solid
$ flutter pub add cached_query_flutter
Source repository

What it does

Provides Flutter-specific builders and configuration extensions for Cached Query. It allows refetching queries automatically on app resume or when connection is re-established, and supplies QueryBuilder, InfiniteQueryBuilder, and MutationBuilder widgets.

AI-written summary of version 3.4.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are already using Cached Query for server state management in Dart.
  • You need UI builders like QueryBuilder or MutationBuilder for your queries.
  • You want automatic query refetching on app resume and connectivity changes.

Skip it when

  • You are not using Cached Query.
  • You want a general-purpose state management solution like Bloc or Riverpod without caching server data.

Strengths

  • Seamlessly integrates Cached Query with Flutter widgets.
  • Automatic refetching on resume and network change via connectivity_plus.
  • Works well alongside other state management patterns like the bloc pattern.

Weaknesses

  • Tight coupling to the Cached Query ecosystem.
  • Requires additional configuration compared to standalone state managers.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Configure CachedQuery with configFlutter instead of config, and optionally initialize CachedStorage.

CachedQuery.instance.configFlutter(
    config: GlobalQueryConfigFlutter(
        refetchOnConnection: true,
        refetchOnResume: true,
    ),
    storage: await CachedStorage.ensureInitialized(),
);

Alternatives

Packages that do the same job and could replace cached_query_flutter.

  • flutter_bloc

    If you prefer a full-fledged event-driven state management architecture rather than dedicated query caching.

  • riverpod

    If you want compile-safe global state management with built-in family and caching capabilities.

  • provider

    If you need a simpler dependency injection and state propagation tool.

Works with

Packages commonly used together with cached_query_flutter: ones it builds on, ones built on it, and its own family.