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

gal कवर
पैकेज विवरणv2.3.3

gal

अनुमति प्रबंधन के साथ छवियों/वीडियो को फ़ोटो गैलरी में सहेजने के लिए फ्लटर प्लगइन

AndroidiOSmacOSWindows
30-दिन डाउनलोड
7.1 लाख
लाइक
595
Pub अंक
160

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

flutter pub add gal

पैकेज अवलोकन

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

गैल पैकेज एक फ्लटर प्लगइन है जो डिवाइस के फोटो गैलरी में छवियों और वीडियो को सहेजने की अनुमति देता है और निर्मित अनुमति प्रबंधन के साथ। यह एंड्रॉइड, आईओएस, मैकओएस और विंडोज का समर्थन करता है, जिससे यह मीडिया निर्यात कार्यक्षमता की आवश्यकता वाले ऐप्स के लिए आदर्श है। प्लगइन अनुमतियों को स्वचालित रूप से प्रबंधित करके गैलरी तक पहुँचने की प्रक्रिया को सरल बनाता है, बॉयलरप्लेट कोड को कम करता है। यह मल्टीमीडिया वर्कफ्लो में बिना किसी बाधा के एकीकृत होता है, खासकर छवि या वीडियो कैप्चर, संपादन या साझाकरण वाले ऐप्स में।

उपयोग

  • गैलरी में कैप्चर की गई छवियों/वीडियो को सहेजें
  • संपादन के बाद मीडिया निर्यात स्वचालित करना
  • क्रॉस-प्लेटफॉर्म ऐप्स में गैलरी एक्सेस को एकीकृत करना
  • मीडिया स्टोरेज के अनुमति अनुरोध का प्रबंधन
  • उपयोगकर्ता-मित्र आधारित मीडिया साझाकरण सक्षम करें

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

  • स्वचालित अनुमति प्रबंधन
  • क्रॉस-प्लेटफ़ॉर्म समर्थन (Android, iOS, macOS, Windows)
  • मीडिया सहेजने के लिए सरल API
  • एम्बेडेड त्रुटि प्रबंधन
  • हल्का और एकीकरण में आसान

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

  • मीडिया कैप्चर विशेषताओं वाले फ्लटर ऐप्स
  • चित्र या वीडियो संपादन उपकरण
  • गैलरी एक्सेस की आवश्यकता वाले ऐप्स
  • मीडिया सहेजने के लिए न्यूनतम सेटअप चाहने वाले डेवलपर्स
  • प्लेटफॉर्म-संगत बहुमाध्यम एप्लिकेशन

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

  • प्लेटफॉर्म-विशिष्ट कॉन्फ़िगरेशन फ़ाइल में उचित अनुमतियाँ आवश्यक हैं
  • विशिष्ट ओएस व्यवहार के लिए अतिरिक्त संभाल की आवश्यकता हो सकती है
  • उन्नत मेटाडेटा नियंत्रण के बिना मूल बचाएं ऑपरेशन तक सीमित
  • अपडेट के लिए बाहरी भंडार पर निर्भर करता है
  • मीडिया चयन या ब्राउज़िंग के लिए डिज़ाइन नहीं किया गया है

मूल README

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

Logo

Gal

Dart3 plugin for saving image or video to photos gallery ios photos google photos microsoft photos

pub.dev »

Since pub points CodeFactor Codacy Badge CI pub package

📢 Support Us

Please support our volunteer efforts by giving us a LIKE👍 and STAR⭐️.

🧠 DeepWiki Documentation

DeepWiki

📱 Supported Platforms

Android iOS macOS Windows Linux
Support SDK 21+ 11+ 11+ 10+ See: gal_linux

Support means that all functions have been tested manually or automatically whenever possible.

📸 Demo

iOS Android
Example ios android

✨ Features

  • Open gallery
  • Save video
  • Save image
  • Save to album
  • Save with metadata
  • Handle permission
  • Handle errors
  • Comprehensive documentation and wiki

🚀 Getting Started

Add Dependency

Add the latest stable version of gal to your dependencies:

flutter pub add gal
iOS Setup

Add the following keys to ios/Runner/Info.plist:

  • <key>NSPhotoLibraryAddUsageDescription</key> Required
  • <key>NSPhotoLibraryUsageDescription</key> Required for iOS < 14 or saving to album

You can copy from example's Info.plist.

Android Setup

Add the following keys to android/app/src/main/AndroidManifest.xml:

  • <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" /> Required for API <= 29
  • android:requestLegacyExternalStorage="true" Required for saving to album in API 29

You can copy from example's AndroidManifest.xml.

[!WARNING] Android emulators with API < 29 require SD card setup. Real devices don't.

macOS Setup

Add the following keys to macos/Runner/Info.plist:

  • <key>NSPhotoLibraryAddUsageDescription</key> Required
  • <key>NSPhotoLibraryUsageDescription</key> Required for saving to album

You can copy from example's Info.plist.

[!WARNING] Flutter currently has a fatal problem for loading info.plist, which may cause permission denials or app crashes in some code editors.

Windows Setup

Update Visual Studio to the latest version for using C++ 20.

[!TIP] If you can't compile, try downloading the latest Windows SDK:

  1. Open Visual Studio Installer
  2. Select Modify
  3. Select Windows SDK
Linux Setup

Linux is not officially supported, but can be added through a non-endorsed federated plugin. See: gal_linux

💻 Usage

Save from Local
// Save Image (Supports two ways)
await Gal.putImage('$filePath');
await Gal.putImageBytes('$uint8List');

// Save Video
await Gal.putVideo('$filePath');

// Save to Album
await Gal.putImage('$filePath', album: '$album')
...
Download from Internet
flutter pub add dio
// Download Image
final imagePath = '${Directory.systemTemp.path}/image.jpg';
await Dio().download('$url',imagePath);
await Gal.putImage(imagePath);

// Download Video
final videoPath = '${Directory.systemTemp.path}/video.mp4';
await Dio().download('$url',videoPath);
await Gal.putVideo(videoPath);
Save from Camera
flutter pub add image_picker
// Capture and Save
final image = await ImagePicker.pickImage(source: ImageSource.camera);
await Gal.putImage(image.path);
flutter pub add camera
// Record and Save
...
final video = await controller.stopVideoRecording();
await Gal.putVideo(video.path);
Handle Permissions
// Check Access Permission
final hasAccess = await Gal.hasAccess();

// Request Access Permission
await Gal.requestAccess();

// ... for saving to album
final hasAccess = await Gal.hasAccess(toAlbum: true);
await Gal.requestAccess(toAlbum: true);
Handle Errors
// Save Image with try-catch
try {
  await Gal.putImage('$filePath');
} on GalException catch (e) {
  log(e.type.message);
}

// Exception Type
enum GalExceptionType {
  accessDenied,
  notEnoughSpace,
  notSupportedFormat,
  unexpected;

  String get message => switch (this) {
        accessDenied => 'Permission to access the gallery is denied.',
        notEnoughSpace => 'Not enough space for storage.',
        notSupportedFormat => 'Unsupported file format.',
        unexpected => 'An unexpected error has occurred.',
      };
}

📚 Documentation

If you write an article about Gal, let us know in the discussion and we'll post the URL in the wiki or readme 🤝

💚 Trusted by Major Projects

Although Gal has only been released for a short time, it's already trusted by major projects.

and more...

श्रेणियाँ

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

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