my_image_picker 0.0.7 copy "my_image_picker: ^0.0.7" to clipboard
my_image_picker: ^0.0.7 copied to clipboard

A Flutter plugin to pick images/videos from gallery or camera with cache support.

📸 my_image_picker #

A Flutter plugin for picking images and videos from gallery and camera with easy-to-use API.

✨ Features #

  • 📷 Pick images from camera/gallery
  • 🎥 Pick videos from camera/gallery
  • 📁 Returns ready-to-use File objects
  • 🗃️ Automatic cache management
  • 🔒 Handles permissions automatically
  • 📱 Supports both Android & iOS

🚀 Installation #

Add to your pubspec.yaml:

dependencies:
  my_image_picker: ^0.0.4

📦 Basic Usage #

import 'package:my_image_picker/my_image_picker.dart';
// Pick single image
File? image = await MyImagePicker.pickImage();
// Pick multiple images
List<File> images = await MyImagePicker.pickMultiImage();
// Pick video
File? video = await MyImagePicker.pickVideo();

⚙️ Platform Setup #

Android #

Add permissions to AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Inside the

<application
  android:requestLegacyExternalStorage="true"
  ... >
   <provider
       android:name="androidx.core.content.FileProvider"
       android:authorities="${applicationId}.provider"
       android:exported="false"
       android:grantUriPermissions="true">
      <meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/provider_paths"/>
   </provider>
</application>

Create File Provider XML Create a file at: android/app/src/main/res/xml/provider_paths.xml

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-files-path
        name="external_files"
        path="." />
</paths>

iOS #

Add to Info.plist:

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs camera access</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) needs photo library access</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) needs microphone access for video</string>

📚 API Reference #

📌 Core Methods #

Method Description Returns Android iOS
pickImageFromCamera() Pick single image File?
pickMultiImage() Pick multiple images (max 10) List<File>
pickVideo() Pick/record video File?
pickMedia() Pick any media type File?

📄 License #

MIT License © 2025 Virendra

Connect with me #

LinkedIn Instagram

💡 Contribution #

Feel free to fork this repo and submit a pull request. All contributions are welcome!

Demo

2
likes
130
points
4
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to pick images/videos from gallery or camera with cache support.

Homepage
Repository (GitHub)

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

camera, flutter, path, path_provider, plugin_platform_interface

More

Packages that depend on my_image_picker

Packages that implement my_image_picker