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

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

dart_strapi

Strapi V4 के लिए Dart क्लाइंट

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
63
लाइक
25
Pub अंक
130

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

flutter pub add dart_strapi

पैकेज अवलोकन

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

एक डार्ट क्लाइंट स्ट्रैपी V4 के लिए, जो डार्ट/फ्लटर एप्लिकेशन और स्ट्रैपी बैकएंड सेवाओं के बीच निरंतर एकीकरण की अनुमति देता है। यह स्ट्रैपी के RESTful एंडपॉइंट्स के साथ बातचीत करने के लिए एक साफ, टाइप-सुरक्षित API प्रदान करता है, जिसमें प्रमाणीकरण, डेटा प्राप्त करना और CRUD ऑपरेशन शामिल हैं। स्ट्रैपी को मुख्य रूप से एक हेडलेस CMS या बैकएंड के रूप में उपयोग करने वाले एप्लिकेशन बनाने वाले डेवलपर्स के लिए डिज़ाइन किया गया है, जो कई प्लेटफॉर्मों के बीच API संचार को सरल बनाता है।

उपयोग

  • Flutter ऐप्स को Strapi V4 बैकएंड्स के साथ एकीकरण
  • हीडलेस CMS से कंटेंट डाउनलोड और प्रबंधित करना
  • Strapi के साथ उपयोगकर्ता प्रमाणीकरण का कार्यान्वयन करें
  • वास्तविक समय के डेटा के साथ डायनामिक वेब और मोबाइल एप्लिकेशन बनाना
  • Flutter क्लाइंट और Strapi सर्वर के बीच डेटा सिंक करना

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

  • प्रकार सुरक्षित API कॉल
  • Strapi V4 प्रमाणीकरण का समर्थन
  • क्रॉस-प्लेटफॉर्म संगतता
  • Flutter pub के साथ आसान सेटअप
  • निर्मित त्रुटि संहार और प्रतिक्रिया विश्लेषण

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

  • Strapi V4 का उपयोग करने वाले Flutter विकासकर्ता
  • हेडलेस CMS-संचालित एप्लिकेशन बनाने वाली टीमें
  • बैकएंड इंटीग्रेशन की आवश्यकता वाले मोबाइल और वेब एप्लिकेशन
  • हल्के Strapi क्लाइंट चाहने वाले डेवलपर्स
  • प्लेटफॉर्म के बीच सुसंगत API इंटरैक्शन की आवश्यकता वाले प्रोजेक्ट

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

  • Strapi V4 बैकएंड की आवश्यकता है
  • REST API पर सीमित (GraphQL समर्थन नहीं)
  • Strapi के API संरचना पर निर्भर
  • उन्नत विशेषताओं के लिए कस्टम एक्सटेंशन की आवश्यकता हो सकती है
  • प्रमाणीकरण प्रवाह को सही विन्यास की आवश्यकता होती है

मूल README

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

dart_strapi

dart client for Strapi V4

For Strapi V3 client check v1.2.0

Example

import 'package:dart_strapi/dart_strapi.dart';

final serverUrl = 'http://localhost:1337';
final authToken = '<token>';
final collection = '<collectionType>';
final single = '<singleType>';

void main() async {
  final client = Strapi(
    serverUrl,
    token: authToken,
  );

  final singleResponse = await client.single.get(single);
  print("Single Response: $singleResponse");
  print("Data: ${singleResponse.item1}");
  print("Meta: ${singleResponse.item2}");
  print("\n----------------------------------------------------\n");

  final singleNotFoundResponse = await client.single.get("lalala");
  print("Single Not Found Response: $singleNotFoundResponse"); // [null, null]
  print("Data: ${singleNotFoundResponse.item1}"); // null
  print("Meta: ${singleNotFoundResponse.item2}"); // null
  print("\n----------------------------------------------------\n");

  final collectionResponse = await client.collection.get(collection);
  print("Collection Response: $collectionResponse");
  print("Data: ${collectionResponse.item1}");
  print("Meta: ${collectionResponse.item2}");
  print("\n----------------------------------------------------\n");

  final collectionNotFoundResponse = await client.collection.get('rarara');
  print("Collection Not Found Response: $collectionNotFoundResponse"); // [null, null]
  print("Data: ${collectionNotFoundResponse.item1}"); // null
  print("Meta: ${collectionNotFoundResponse.item2}"); // null
  print("\n----------------------------------------------------\n");

  final collectionSingleResponse = await client.collection.getOne(collection, 1);
  print("Collection Single Response: $collectionSingleResponse");
  print("Data: ${collectionSingleResponse.item1}");
  print("Meta: ${collectionSingleResponse.item2}");
  print("\n----------------------------------------------------\n");

  final collectionSingleNotFoundResponse = await client.collection.getOne("xaxaxa", 1);
  print("Collection Single Not Found Response: $collectionSingleNotFoundResponse"); // [null, null]
  print("Data: ${collectionSingleNotFoundResponse.item1}"); // null
  print("Meta: ${collectionSingleNotFoundResponse.item2}"); // null
  print("\n----------------------------------------------------\n");

  final resourceSingle = await client.resource.get(single);
  print("Resource Single Response: $resourceSingle"); // Response<Data.single>
  print("\n----------------------------------------------------\n");

  final resourceCollection = await client.resource.get(collection);
  print("Resource Collection Response: $resourceCollection"); // Response<Data.collection>
  print("\n----------------------------------------------------\n");

  final resourceCollectionSingle = await client.resource.get("$collection/1");
  print("Resource Collection Single Response: $resourceCollectionSingle"); // Response<Data.single>
  print("\n----------------------------------------------------\n");

  final resourceNoExists = await client.resource.get("lalala");
  print("Resource Not Found Response: $resourceNoExists"); // Response.error
  print("\n----------------------------------------------------\n");
}

Output

Single Response: [{id: 1, attributes: {...}}, Meta(pagination: null)]
Data: {id: 1, attributes: {...}}
Meta: Meta(pagination: null)

----------------------------------------------------

Single Not Found Response: [null, null]
Data: null
Meta: null

----------------------------------------------------

Collection Response: [[{id: 1, attributes: {...}}, {id: 2, attributes: {...}}], Meta(pagination: Pagination(page: 1, pageSize: 25, pageCount: 1, total: 2))]
Data: [{id: 1, attributes: {...}}, {id: 2, attributes: {...}}]
Meta: Meta(pagination: Pagination(page: 1, pageSize: 25, pageCount: 1, total: 2))

----------------------------------------------------

Collection Not Found Response: [null, null]
Data: null
Meta: null

----------------------------------------------------

Collection Single Response: [{id: 1, attributes: {...}}, Meta(pagination: null)]
Data: {id: 1, attributes: {...}}
Meta: Meta(pagination: null)

----------------------------------------------------

Collection Single Not Found Response: [null, null]
Data: null
Meta: null

----------------------------------------------------

Resource Single Response: Response(data: Data.single(data: {id: 1, attributes: {...}}), meta: Meta(pagination: null))

----------------------------------------------------

Resource Collection Response: Response(data: Data.collection(data: [{id: 1, attributes: {...}}, {id: 2, attributes: {...}}]), meta: Meta(pagination: Pagination(page: 1, pageSize: 25, pageCount: 1, total: 2)))

----------------------------------------------------

Resource Collection Single Response: Response(data: Data.single(data: {id: 1, attributes: {...}}), meta: Meta(pagination: null))

----------------------------------------------------

Resource Not Found Response: Response.error(message: ...)

----------------------------------------------------

This package is in active development process, there are implemented methods to query, if you need create / update / delete or call other api you can use client.httpClient to call Dio client directly.

Check Examples for more

श्रेणियाँ

निर्भरताएँ

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

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

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

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