सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Firebase Cloud Firestore के लिए हल्का ऑब्जेक्ट डॉक्यूमेंट मैपर (ODM), जो Flutter ऐप में डेटा मॉडलिंग और CRUD ऑपरेशन को सरल बनाता है। यह Dart क्लासेज को Firestore दस्तावेज़ों में मैप करने के लिए साफ, टाइप-सुरक्षित इंटरफ़ेस प्रदान करता है, बॉयलरप्लेट कोड को कम करता है और डेवलपर उत्पादकता को बढ़ाता है। यह पैकेज आधिकारिक cloud_firestore SDK के साथ बिल्कुल एकीकृत है, स्थानीय ऑब्जेक्ट्स और दूरस्थ Firestore संग्रहों के बीच आसान सिंक्रनाइज़ेशन की अनुमति देता है। विकासकर्ताओं के लिए डिज़ाइन किया गया है जो लचीलापन या प्रदर्शन के बिना संरचित डेटा हैंडलिंग चाहते हैं।
उपयोग
Dart क्लासेज को Firestore दस्तावेज़ में मैप करना
CRUD ऑपरेशन को सरल बनाना
स्केलेबल ऐप डेटा मॉडल बनाना
Firestore इंटरैक्शन में बॉयलरप्लेट को कम करना
प्रकार सुरक्षित डेटा पहुँच सक्षम करें
मुख्य विशेषताएँ
स्वचालित दस्तावेज़ से ऑब्जेक्ट मैपिंग
प्रकार सुरक्षित डेटा मॉडलिंग
न्यूनतम बॉयलरप्लेट
cloud_firestore के साथ निरंतर एकीकरण
नेस्टेड ऑब्जेक्ट्स और संग्रह का समर्थन
इनके लिए उपयुक्त
Firebase Cloud Firestore का उपयोग करने वाले Flutter ऐप्स
संरचित डेटा प्रबंधन की तलाश में विकासकर्ता
रखरखाव डेटा परत डिज़ाइन की आवश्यकता वाले प्रोजेक्ट
कोड पठनीयता और सामंजस्य को प्राथमिकता देने वाली टीमें
जटिल डेटा मॉडल वाले ऐप्स
विचार योग्य बातें
Firestore डेटा संरचना की समझ की आवश्यकता है
फायरस्टोर के विशिष्ट उपयोग मामलों तक सीमित
सरल डेटा की आवश्यकताओं के लिए थोड़ा अतिरिक्त ओवरहेड जोड़ सकता है
cloud_firestore SDK संगतता संस्करण पर निर्भर करता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Cloud Firestore ODM Package for Flutter
The Cloud Firestore ODM package enables developers to build fully type-safe applications for Flutter using the FlutterFire Cloud Firestore plugin.
The Cloud Firestore ODM is currently in alpha. Expect breaking changes, API changes and more. The documentation is still a work in progress. See the discussion for more details.
What is an ODM?
The Object Document Mapper or ODM is an interface that treats a document as a tree structure wherein each node is an object representing a part of the document.
ODM methods allow programmatic access to the tree making it possible to change the structure, style or content of a document.
What does it do?
The Cloud Firestore ODM package enables developers to build fully type-safe applications for Flutter using the FlutterFire Cloud Firestore plugin.
The ODM allows data schemas to be defined which represent the data structure of your Cloud Firestore database. By defining schemas the ODM provides the following benefits:
↔️ Bi-directional data validation.
🔒 Type-safe data querying, supporting all Firestore query operations.
🔄 Flutter Widgets for simple data binding with your data.
🎯 Data selectors to help avoid unnecessary Widget rebuilds.
💻 Full API code completion.
Installation
1. Use a recent Dart version
The ODM relies on a recent Dart feature: generic annotations.
As such, to use the ODM you will need to upgrade your Dart SDK to enable this feature.
That is done by adding the following to your pubspec.yaml:
5. Enable create_field_map and create_per_field_to_json of json_serializable
For the ODM to work, it is necessary to enable the create_field_map and create_per_field_to_json of json_serializable.
This can be done by creating a build.yaml file next to your pubspec.yaml and
paste the following: