Package selection guidance compiled from public package information, community data, and project usage.
fl_query is a Flutter package designed for managing asynchronous data with built-in caching, automatic refetching, and cache invalidation. It simplifies state management by handling data fetching, loading states, errors, and cached responses efficiently. Ideal for apps requiring real-time or frequently updated data, it reduces boilerplate code and ensures consistent data across the app. The library integrates seamlessly with Flutter's reactive ecosystem and supports all major platforms.
Use cases
Real-time data updates
Offline-first applications
API data synchronization
Dynamic UIs with async data
Caching API responses
Automated data refresh
Key features
Built-in caching
Automatic refetching
Cache invalidation
Minimal boilerplate
Cross-platform support
Error handling
Suitable for
Developers using state management
Apps with frequent API calls
Projects needing offline capabilities
Teams prioritizing developer productivity
Flutter apps with dynamic content
Considerations
Requires understanding of async/await patterns
May increase memory usage with large caches
Best suited for moderate to high data frequency
Limited customization for complex cache strategies
Not ideal for simple static data
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Fl-Query
Asynchronous data caching, refetching & invalidation library for Flutter. FL-Query lets you manage & distribute your async data without touching any global state
Fl-Query makes asynchronous server state management a breeze in flutter
Features
Async data caching & management
Smart + effective refetching
Optimistic updates
Automatically cached data invalidation & unneeded query/mutation garbage collection
Infinite pagination via InfiniteQuery
Lazy persistent cache (Uses hive for persisting query results to disk) (optional)
Let's write use a Query now
FL-Query provides a QueryBuilder widget that creates and listens to the specified Query
and re-runs the builder function whenever there's an update
It has 2 required parameters(unnamed) key & builder
To master the fl-query follow the official blog at https://fl-query.krtirtho.dev/blog
Why?
The main purpose of Fl-Query is providing the easiest way to manage the messy server-state part requiring the least amount of code with code reusability & performance
This let's you focus more on those cool UI animations & transitions✨. Leave the boring stuff to fl-query
Q. Isn't FutureBuilder good?
No, of course not. Unless you're from 2013 or your app is a purely offline app
Q. So FutureProvider from riverpod or provider not enough?
Probably yes. Although riverpod@v2 has added a lot of caching related features but still optimistic updates, periodic refetching & disk persistence are missing. Let's not forget about infinite pagination, it's a nightmare😅. In case of provider, same story. It's a great package but it's not ideal for server-state management
Notice Board
We need some bada** coders to write tests and ruin our life🥲
100% coverage is our goal🙃