adaptive_media_picker 0.0.4 copy "adaptive_media_picker: ^0.0.4" to clipboard
adaptive_media_picker: ^0.0.4 copied to clipboard

Adaptive Flutter media picker for images & videos with smart permissions, limited access UI, and cross-platform support (Android, iOS, Web, Desktop).

πŸ“Έ Adaptive Media Picker #

Pub.dev Badge Build Badge MIT License Flutter Badge

πŸš€ Adaptive, permission-aware media picker for Flutter
Handles limited & full access gracefully, with native-like UX across Android, iOS, Web, and Desktop.


✨ Why Adaptive Media Picker? #

Most media pickers only open the gallery or camera β€” but don’t handle modern permission flows like limited access on iOS/Android.

This package makes it super easy for developers by:

βœ… Automatically handling permissions
βœ… Providing a built-in limited-access sheet
βœ… Falling back smartly for unsupported platforms (desktop/web)
βœ… Offering one simple API for images & videos

Pick image Pick multiple images Pick video

Built-in Limited Access UI (system-native UI used for full access)


πŸš€ Features #

  • πŸ“· Pick single image, multiple images, or single video
  • πŸ” Permission-aware (handles full, limited, denied states)
  • πŸ–ΌοΈ Custom limited-access bottom sheet (powered by photo_manager)
  • 🌍 Works on mobile, web, and desktop
  • 🎯 No dart:io β†’ safe for web builds
  • πŸŽ₯ Fallback to gallery when camera unavailable (e.g., web/desktop)

⚠️ Note: Multiple video selection is not supported by native APIs.


⚑ Quick Start #

final picker = AdaptiveMediaPicker();

// Pick a single image
final singleImage = await picker.pickImage(
  context: context,
  options: const PickOptions(
    source: ImageSource.gallery,
    imageQuality: 80,
  ),
);
if (singleImage.item != null) {
  // use singleImage.item
}

// Pick multiple images (max 5)
final multiImages = await picker.pickMultiImage(
  context: context,
  options: const PickOptions(maxImages: 5, source: ImageSource.gallery),
);

// Pick a single video
final singleVideo = await picker.pickVideo(
  context: context,
  options: const PickOptions(source: ImageSource.gallery),
);

πŸ“Œ Common Use Cases #

βœ… Pick profile picture (single image)
βœ… Select multiple images for an album/post
βœ… Pick a single video from gallery/camera
βœ… Handle limited-access gracefully with a ready-to-use bottom sheet


πŸ” Limited Access UX #

When the user grants limited access:

  • A dialog is shown with:
    • Manage Selection (iOS only)
    • Open Settings (iOS/macOS/Android)
  • If the user interacts, the sheet closes automatically

You don’t need to handle permissions manually β€” the picker does it for you.


βš™οΈ Platform Setup #

πŸ“± Android #

Add required permissions in AndroidManifest.xml:

<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.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

🍎 iOS #

Add to Info.plist:

<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photo library access to pick images.</string>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to take photos and videos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access when recording videos.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app may save images/videos to your photo library.</string>

πŸ’» Desktop (Windows, macOS, Linux) #

  • Uses file_selector via image_picker
  • No runtime permissions (file dialog is native)
  • Camera capture not supported
  • On macOS, add to Info.plist:
<key>com.apple.security.files.user-selected.read-only</key>
<true/>

🌐 Web #

  • Uses browser file picker
  • Camera capture not supported

🧩 API Overview #

Options #

  • maxImages β†’ Limit for multi-image picking
  • imageQuality, maxWidth, maxHeight β†’ Resize/compression options
  • source β†’ ImageSource.gallery | ImageSource.camera
  • Settings dialog options β†’ showOpenSettingsDialog, settingsDialogTitle, settingsDialogMessage, etc.

Results #

  • PickResultSingle { item, permissionResolution }
  • PickResultMultiple { items, permissionResolution }

Methods #

  • pickImage β†’ Single image
  • pickMultiImage β†’ Multiple images
  • pickVideo β†’ Single video

πŸ‘€ Author #

Created with ❀️ by Jaimin Kavathia


πŸ“œ License #

Licensed under the MIT License β†’ Open Source, Free to Use


⭐ If you like this package, give it a star on GitHub & pub.flutter-io.cn!

8
likes
160
points
281
downloads

Publisher

unverified uploader

Weekly Downloads

Adaptive Flutter media picker for images & videos with smart permissions, limited access UI, and cross-platform support (Android, iOS, Web, Desktop).

Repository (GitHub)
View/report issues

Topics

#image-picker #video-picker #camera #gallery #file-selection

Documentation

API reference

License

MIT (license)

Dependencies

device_info_plus, flutter, flutter_screenutil, image_picker, permission_handler, photo_manager

More

Packages that depend on adaptive_media_picker