adaptive_media_picker 0.0.5 copy "adaptive_media_picker: ^0.0.5" to clipboard
adaptive_media_picker: ^0.0.5 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
βœ… Optional image cropping (Android/iOS/Web)
βœ… 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
  • βœ‚οΈ Crop support for single images (Android, iOS, Web)
  • πŸ” Permission-aware (handles full, limited, denied states)
  • πŸ–ΌοΈ Built-in limited-access bottom sheet
  • 🌍 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.


πŸ—‚οΈ Platform Support Matrix #

Feature Android iOS Web macOS Windows Linux
Single image pick βœ… βœ… βœ… βœ… βœ… βœ…
Multi-image pick βœ… βœ… βœ… βœ… βœ… βœ…
Single video pick βœ… βœ… βœ… βœ… βœ… βœ…
Multiple videos ❌ ❌ ❌ ❌ ❌ ❌
Camera capture βœ… βœ… ❌ ❌ ❌ ❌
Limited-access UX βœ… βœ… ❌ βœ… ❌ ❌
Cropping (single image) βœ… βœ… βœ… ❌ ❌ ❌

⚑ Quick Start #

final picker = AdaptiveMediaPicker();

// Pick a single image
final singleImage = await picker.pickImage(
  context: context,
  options: const PickOptions(
    source: ImageSource.gallery,
    imageQuality: 80,
  ),
);

// Pick a single image with cropping (Android/iOS/Web)
final croppedImage = await picker.pickImage(
  context: context,
  options: const PickOptions(
    source: ImageSource.gallery,
    wantToCrop: true,
  ),
);

// Pick multiple images
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 (with optional crop) βœ… Select multiple images for an album/post βœ… Pick a single video from gallery/camera βœ… Handle limited-access gracefully with a built-in bottom sheet


βœ‚οΈ Cropping Setup #

Cropping works for Android, iOS, and Web only. On desktop platforms cropping is ignored and the original image is returned.

Android #

Add UCropActivity to your AndroidManifest.xml:

<activity
  android:name="com.yalantis.ucrop.UCropActivity"
  android:screenOrientation="portrait"
  android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

(Android embedding v2 required)

iOS #

No additional configuration needed.

Web #

Add cropperjs to your web/index.html:

<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.2/cropper.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.2/cropper.min.js"></script>

πŸ” 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


βš™οΈ Platform Setup (Permissions) #

Android #

<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 #

<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>

macOS #

<key>com.apple.security.files.user-selected.read-only</key>
<true/>

Desktop (Windows, macOS, Linux) β†’ uses native file dialogs. Camera not supported.


🧩 API Overview #

Options #

  • maxImages β†’ Limit for multi-image picking
  • imageQuality, maxWidth, maxHeight β†’ Resize/compression options
  • source β†’ ImageSource.gallery | ImageSource.camera
  • wantToCrop β†’ Enable cropping (Android/iOS/Web, single-image only)
  • Dialog / settings options β†’ showOpenSettingsDialog, settingsDialogTitle, settingsDialogMessage

Results #

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

Methods #

  • pickImage β†’ Single image (with optional crop)
  • pickMultiImage β†’ Multiple images
  • pickVideo β†’ Single video

πŸ‘€ Author #

Created with ❀️ by Jaimin Kavathia Connect on LinkedIn


πŸ“œ License #

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


⭐ If you like this package, give it a star on GitHub & pub.dev!

29
likes
0
points
161
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

License

unknown (license)

Dependencies

device_info_plus, flutter, flutter_screenutil, image_cropper, image_picker, permission_handler, photo_manager

More

Packages that depend on adaptive_media_picker