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

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

unsplash_client

Unsplash मुफ्त उच्च-रिज़ॉल्यूशन फोटो प्रदान करता है। यह उनके REST API के लिए एक क्लाइंट है।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
3.8 हज़ार
लाइक
67
Pub अंक
160

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

flutter pub add unsplash_client

पैकेज अवलोकन

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

unsplash_client पैकेज Unsplash REST API के लिए एक Dart क्लाइंट है, जो डेवलपर्स को Flutter ऐप में सीधे उच्च-रिज़ॉल्यूशन, मुफ्त उपयोग के लिए फोटो प्राप्त करने की अनुमति देता है। यह पैकेज फोटो, उपयोगकर्ता और संग्रहों के लिए एंडपॉइंट्स के लिए खोज, प्राप्त करने और प्रबंधन के लिए संरचित पहुंच प्रदान करके Unsplash की छवि लाइब्रेरी के साथ एकीकरण को सरल बनाता है। पैकेज सभी प्रमुख प्लेटफॉर्म, जैसे मोबाइल, वेब और डेस्कटॉप का समर्थन करता है, जिससे डायनामिक, दृश्य रूप से समृद्ध सामग्री की आवश्यकता वाले ऐप्स के लिए आदर्श बनता है। साफ और स्पष्ट API के साथ, यह Unsplash के डेटा के साथ काम करते समय बॉयलरप्लेट कोड को कम करता है।

उपयोग

  • यादृच्छिक या खोजी तस्वीरें डाउनलोड करें
  • चयनित फोटो संग्रह प्रदर्शित कर रहे हैं
  • एप्प में फ्री स्टॉक फोटोज को एकीकृत करना
  • दृश्य सामग्री खोज सुविधाओं का निर्माण
  • उच्च गुणवत्ता वाली छवियों के साथ ऐप UI में सुधार

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

  • सरल REST API वраФ퍰
  • सभी प्लेटफॉर्म (Android, iOS, Web, macOS, Windows, Linux) को समर्थन करता है
  • तस्वीरों, उपयोगकर्ताओं और संग्रह के लिए निर्मित मॉडल
  • आसान खोज और पेजिंग
  • प्रकार सुरक्षित प्रतिक्रियाएँ
  • सक्रिय रूप से रखरखाव और ओपन-सोर्स

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

  • मुफ्त स्टॉक इमेज की आवश्यकता वाले ऐप्स
  • डिज़ाइन-केंद्रित या दृश्य सामग्री प्लेटफॉर्म
  • फोटो गैलरी या प्रेरणा ऐप्स
  • Flutter का उपयोग करके प्लेटफॉर्म-स्वतंत्र प्रोजेक्ट्स
  • विश्वसनीय छवि स्रोत की तलाश में विकासकर्ता

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

  • Unsplash से API की की आवश्यक है
  • प्रत्येक API कुंजी पर दर सीमाएँ लागू होती हैं
  • Unsplash की छवि संग्रहालय तक सीमित
  • नेटवर्क कनेक्टिविटी पर निर्भर करता है
  • ऑफलाइन उपयोग के लिए कैशिंग की आवश्यकता हो सकती है

मूल README

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

pub.dev package page GitHub Actions CI GitHub Stars

Unsplash provides free high-resolution photos. This is a client for their REST API.


If you're looking for a database solution, check out cbl, another project of mine. It brings Couchbase Lite to standalone Dart and Flutter, with support for:

  • Full-Text Search,
  • Expressive Queries,
  • Data Sync,
  • Change Notifications

and more.


Limitations

Endpoints that act on behalf of a user are not implemented, yet.If that is something you need, please comment on this issue.

Requirements

You need to register as a developer and create an Unsplash app to access the API.

Getting started

Create an UnsplashClient

Use the credentials for your app, obtained from the developer portal, to create an UnsplashClient:

final client = UnsplashClient(
  settings: ClientSettings(credentials: AppCredentials(
    accessKey: '...',
    secretKey: '...',
  )),
);

:warning: When you are done using a client instance, make sure to call it's close method.

Get a random photo

// Call `goAndGet` to execute the [Request] returned from `random`
// and throw an exception if the [Response] is not ok.
final photos = await client.photos.random(count: 1).goAndGet();

// The api returns a `Photo` which contains metadata about the photo and urls to download it.
final photo = photos.first;

Photo variants

A Photo comes with a set of urls for variants of the photo of different sizes, such as regular and thumb:

final thumb = photo.urls.thumb;

If the provided variants are not a good fit for your use, you can generate urls where you specify size, quality, fit and other parameters.

Call the extension method Uri.resizePhoto on photo.urls.raw to generate an Uri for a custom variant:

final custom = photo.urls.raw.resizePhoto(width: 400, height: 400);

Example

The example is a simple CLI app that fetches a few random photos.


Gabriel Terwesten • GitHub @blaugold • Twitter @GTerwesten • Medium @gabriel.terwesten

श्रेणियाँ

निर्भरताएँ

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

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

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