पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv2.21.7

firestore_cache

एक फ्लटर प्लगइन जो कैश से पहले पढ़ने के बाद सर्वर से फायरस्टोर डॉक्यूमेंट्स को लाने के लिए है

AndroidiOSWebmacOSWindows
30-दिन डाउनलोड
3.3 हज़ार
लाइक
107
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add firestore_cache

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

firestore_cache एक Flutter पैकेज है जो Firestore डॉक्यूमेंट्स को कैश से पहले पढ़ने की रणनीति के साथ लाने में सक्षम बनाता है, जिससे त्वरित स्थानीय प्रतिक्रिया सुनिश्चित होती है और सर्वर के साथ सिंक करना वैकल्पिक होता है। यह तत्काल प्रदर्शन के लिए कैश्ड डेटा को प्राथमिकता देता है और सर्वर से कैश को असिंक्रोनस रूप से अपडेट करता है, जिससे नेटवर्क देरी या ऑफलाइन परिस्थितियों में ऐप प्रदर्शन और उपयोगकर्ता अनुभव में सुधार होता है। पैकेज सभी प्रमुख प्लेटफॉर्म जैसे Android, iOS, Web, macOS और Windows को समर्थन देता है, जिससे यह त्वरित डेटा एक्सेस और फॉलबैक विश्वसनीयता की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है।

उपयोग

  • ऑफलाइन-प्रथम डेटा प्राप्ति
  • त्वरित प्रारंभिक UI रेंडरिंग
  • Firestore के साथ बैकग्राउंड सिंक
  • सुधारित ऐप प्रतिक्रियाशीलता
  • निरंतर नेटवर्क पुनर्स्थापना

मुख्य विशेषताएँ

  • कैश-प्रथम दस्तावेज़ प्राप्त करना
  • स्वचालित सर्वर सिंक
  • क्रॉस-प्लेटफ़ॉर्म समर्थन
  • सरल API एकीकरण
  • तात्कालिक डेटा सुसंगतता

इनके लिए उपयुक्त

  • त्वरित स्थानीय डेटा पहुँच की आवश्यकता वाले ऐप्स
  • ऑफलाइन क्षमता के लिए विकासकर्ता
  • Firebase Firestore का उपयोग करने वाले प्रोजेक्ट
  • तत्काल प्रतिक्रिया की आवश्यकता वाले UI
  • अनिश्चित नेटवर्क कनेक्शन वाले एप्लिकेशन

विचार योग्य बातें

  • शुरुआत में अप्रासंगिक डेटा प्रदान कर सकता है
  • कैश अमान्यीकरण का सावधानीपूर्वक उपचार आवश्यक है
  • वास्तविक समय महत्वपूर्ण अद्यतन के लिए उपयुक्त नहीं
  • Firestore दस्तावेज़ पढ़ने तक सीमित
  • नेटवर्क उपयोग सिंक आवृत्ति पर निर्भर करता है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Firestore Cache

pub package docs MIT License GitHub Actions codecov Codacy Badge style: flutter_lints

Github-sponsors BuyMeACoffee Ko-Fi LiberaPay Patreon PayPal

A Flutter plugin for fetching Firestore documents with read from cache first then server.

This plugin is mainly designed for applications using the DocumentReference.get() and Query.get() methods in the cloud_firestore plugin, and is implemented with read from cache first then server.

Getting Started

Add this to your package's pubspec.yaml file:

dependencies:
  firestore_cache: ^2.21.2
Usage

Before using the plugin, you will need to create a document on Firestore and create a timestamp field in that document. See the screenshot below for an example:

Firestore Screenshot

⚠️ PLEASE NOTE This plugin does not compare the documents in the cache and the ones in the server to determine if it should fetch data from the server. Instead, it relies on the timestamp field in the document to make that decision. And so your application should implement the logic to update this field if you want to read new data from the server instead of reading it from the cache.

You should also create different timestamp fields for different collections or documents that you are fetching.

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firestore_cache/firestore_cache.dart';

// This should be the path of the document containing the timestamp field
// that you created
final cacheDocRef = Firestore.instance.doc('status/status');

// This should be the timestamp field in that document
final cacheField = 'updatedAt';

final query = Firestore.instance.collection('posts');
final snapshot = await FirestoreCache.getDocuments(
    query: query,
    cacheDocRef: cacheDocRef,
    firestoreCacheField: cacheField,
);

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 2 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।