सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
fl_query एक फ्लटर पैकेज है जिसका उपयोग एसिंक्रोनस डेटा के प्रबंधन के लिए किया जाता है, जिसमें इंबिल्ट कैशिंग, स्वचालित रीफेचिंग और कैश वैलिडेशन शामिल है। यह डेटा फेचिंग, लोडिंग स्टेट्स, त्रुटियाँ और कैश्ड रिप्लाई को प्रभावी ढंग से प्रबंधित करके स्टेट मैनेजमेंट को सरल बनाता है। वास्तविक समय या नियमित रूप से अपडेट होने वाले डेटा की आवश्यकता वाले ऐप्स के लिए उपयुक्त, यह बॉइलरप्लेट कोड को कम करता है और ऐप में स्थिर डेटा सुनिश्चित करता है। लाइब्रेरी फ्लटर के रिएक्टिव इकोसिस्टम के साथ बिना किसी दिक्कत के एकीकृत होती है और सभी प्रमुख प्लेटफॉर्म का समर्थन करती है।
उपयोग
वास्तविक समय डेटा अपडेट
ऑफलाइन-प्रथम एप्लिकेशंस
API डेटा सिंक्रनाइजेशन
असिंक्रोनस डेटा के साथ डायनामिक UI
API प्रतिक्रियाओं को कैश करना
स्वचालित डेटा रीफ्रेश
मुख्य विशेषताएँ
निर्मित कैशिंग
स्वचालित रीफेच
कैश अमान्यता
न्यूनतम बॉयलरप्लेट
क्रॉस-प्लेटफ़ॉर्म समर्थन
त्रुटि प्रबंधन
इनके लिए उपयुक्त
राज्य प्रबंधन का उपयोग करने वाले विकासकर्ता
अक्सर API कॉल वाले ऐप्स
ऑफलाइन क्षमता की आवश्यकता वाले प्रोजेक्ट
विकासक उत्पादकता पर ध्यान केंद्रित टीमें
गतिशील सामग्री वाले Flutter ऐप्स
विचार योग्य बातें
async/await पैटर्न की समझ की आवश्यकता होती है
बड़े कैश के साथ मेमोरी उपयोग बढ़ सकता है
मध्यम से उच्च डेटा आवृत्ति के लिए सबसे उपयुक्त
जटिल कैश रणनीतियों के लिए सीमित कस्टमाइजेशन
सरल स्थिर डेटा के लिए उपयुक्त नहीं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
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🙃