flutter_requery
0.1.16, released 4 years ago by coreline.agency
Flutter widget library for fetching, caching and invalidating async data.
WASM-ready
What it does
Provides a Query widget that runs a Future, caches its result and rebuilds on cache invalidation. A global queryCache lets you invalidate or optimistically update cached data.
AI-written summary of version 0.1.16, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need simple data fetching without boilerplate like Bloc or FutureBuilder
- You want automatic cache invalidation and optimistic updates across screens
Skip it when
- Complex state logic that requires fine‑grained control
- You need a full‑featured networking client (e.g., Dio)
Strengths
- Minimal API, easy to drop into existing code
- Built‑in cache invalidation and optimistic response support
Weaknesses
- Limited to simple Future‑based queries, no built‑in retry or pagination
- No code generation or advanced networking features
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Query<List<String>>(
'myKey',
future: () async => ["Hello"],
builder: (context, response) {
if (response.loading) return Text('Loading...');
if (response.error != null) return Text('Error');
return ListView(children: response.data.map((e) => Text(e)).toList());
},
);Alternatives
Packages that do the same job and could replace flutter_requery.
- more
A collection of utility extensions and specialized data structures for Dart.
90Compare - structured_async
Structured asynchronous programming and cancellable futures for Dart.
39Compare