Viewing version 0.8.13+25. Open the latest package page.
image_picker_android
0.8.13+25Android implementation of the image_picker plugin.
Readme
image_picker_android
The Android implementation of image_picker.
Usage
This package is endorsed, which means you can simply use image_picker
normally. This package will be automatically included in your app when you do,
so you do not need to add it to your pubspec.yaml.
However, if you import this package to use any of its APIs directly, you
should add it to your pubspec.yaml as usual.
Photo Picker
On Android 16 and above, gallery image, video, and mixed-media picks always
use the Android Photo Picker. ImagePickerAndroid.useAndroidPhotoPicker has
no effect on those versions.
On Android 15 and below, this package has optional Android Photo Picker
functionality. To enable it, add the following code to your app before calling
any image_picker APIs:
import 'package:image_picker_android/image_picker_android.dart';
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart';
// ···
final ImagePickerPlatform imagePickerImplementation = ImagePickerPlatform.instance;
if (imagePickerImplementation is ImagePickerAndroid) {
imagePickerImplementation.useAndroidPhotoPicker = true;
}
In addition, ImagePickerAndroid.useAndroidPhotoPicker must be set to true to use the limit functionality. It is implemented based on ActivityResultContract, so it can only be ensured to take effect on Android 13 or above. Otherwise, it depends on whether the corresponding system app supports it.
Changelog
0.8.13+25
- Fixes resizing with
maxWidthormaxHeightalways decoding the full-size image; large images are now subsampled while decoding.
0.8.13+24
- Updates Robolectric to 4.17 and adds the JVM arguments it requires for unit tests.
- Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
0.8.13+23
- Fixes a crash when the content provider returns no stream for a picked
image; the pick now fails with
missing_valid_image_uriinstead.
0.8.13+22
- Fixes gallery image/video selection on Android API 36+ returning no paths when
useAndroidPhotoPickerwas false. The plugin now uses the Android Photo Picker on API 36 and above regardless of that flag.
0.8.13+21
- Updates pigeon dev_dependency to ^27.3.2 for analyzer 14 compatibility.
0.8.13+20
- Bumps androidx.activity:activity from 1.12.4 to 1.13.0.
0.8.13+19
- Bumps the androidx group across 10 directories with 1 update.
0.8.13+18
- Migrates to Built-in Kotlin to support AGP 9.
- Updates minimum supported SDK version to Flutter 3.44/Dart 3.12.
0.8.13+17
- Updates internal implementation to use Kotlin Pigeon.
0.8.13+16
- Bumps androidx.core:core from 1.17.0 to 1.18.0.
0.8.13+15
- Updates build files from Groovy to Kotlin.
0.8.13+14
- Bumps androidx.activity:activity from 1.12.2 to 1.12.4.
0.8.13+13
- Bumps androidx.activity:activity from 1.11.0 to 1.12.2.
0.8.13+12
- Bump androidx.core:core from 1.13.1 to 1.17.0.
0.8.13+11
- Bumps androidx.exifinterface:exifinterface from 1.4.1 to 1.4.2.
0.8.13+10
- Bumps com.android.tools.build:gradle from 8.12.1 to 8.1.
0.8.13+9
- Bumps androidx.activity:activity from 1.10.1 to 1.11.0.
0.8.13+8
- Updates to Pigeon 26.
0.8.13+7
- Removes reference to internal
isSystemPickerAvailable$activity_release()method.
0.8.13+6
- Fixes typo in limit parameter validation error message.
0.8.13+5
- Updates Java compatibility version to 17 and minimum supported SDK version to Flutter 3.35/Dart 3.9.
0.8.13+4
- Resolves Gradle 9 deprecations.
0.8.13+3
- Bumps androidx.exifinterface:exifinterface from 1.3.7 to 1.4.1.
0.8.13+2
- Updates minimum supported SDK version to Flutter 3.35.
- Removes obsolete code related to supporting SDK <24.
0.8.13+1
- Bumps com.android.tools.build:gradle to 8.12.1.
- Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
0.8.13
- Adds support for
getMultiVideoWithOptions.
0.8.12+25
- Updates kotlin version to 2.2.0 to enable gradle 8.11 support.
0.8.12+24
- Updates
androidx.activity:activityto 1.10.1.
0.8.12+23
- Removes obsolete code related to supporting SDK <21.
0.8.12+22
- Updates compileSdk 34 to flutter.compileSdkVersion.
0.8.12+21
- Ensures that platform messages on background queues are handled in order.
0.8.12+20
- Updates androidx.annotation:annotation to 1.9.1.
0.8.12+19
- Updates androidx.activity:activity to 1.9.3.
0.8.12+18
- Fixes a security issue related to improperly trusting filenames provided by a
ContentProvider.
0.8.12+17
- Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0.
0.8.12+16
- Updates Pigeon for non-nullable collection type support.
0.8.12+15
- Updates Java compatibility version to 11.
0.8.12+14
- Bumps androidx.activity:activity from 1.9.1 to 1.9.2.
0.8.12+13
- Removes dependency on org.jetbrains.kotlin:kotlin-bom.
- Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.
0.8.12+12
- Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2.
0.8.12+11
- Bumps androidx.annotation:annotation from 1.8.0 to 1.8.1.
0.8.12+10
- Bumps androidx.activity:activity from 1.9.0 to 1.9.1.
0.8.12+9
- Bumps androidx.annotation:annotation from 1.7.1 to 1.8.0.
0.8.12+8
- Updates lint checks to ignore NewerVersionAvailable.
0.8.12+7
- Bumps androidx.activity:activity from 1.8.2 to 1.9.0.
0.8.12+6
- Bumps androidx.activity:activity from 1.7.2 to 1.8.2.
0.8.12+5
- Updates Android Gradle Plugin to 8.5.1.
0.8.12+4
- Bumps androidx.core:core from 1.10.1 to 1.13.1.
0.8.12+3
- Update documentation to note that limit is not always supported.
0.8.12+2
- Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
- Removes support for apps using the v1 Android embedding.
0.8.12+1
- Fixes another app crash case on Android 12+, and refactors getting of paths from intents.
0.8.12
- Fixes app crashes on Android 12+ caused by selecting images with size 0.
0.8.11
- Updates documentation to note that Android Photo Picker use is not optional on Android 13+.
0.8.10
- Adds limit parameter to
MediaOptionsandMultiImagePickerOptionsthat sets a limit to how many media or image items can be selected.
0.8.9+6
- Updates minSdkVersion to 19.
- Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
0.8.9+5
- Bumps androidx.exifinterface:exifinterface from 1.3.6 to 1.3.7.
0.8.9+4
- Minimizes scope of deprecation warning suppression to only the versions where it is required.
- Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
- Updates compileSdk version to 34.
0.8.9+3
- Bumps androidx.annotation:annotation from 1.7.0 to 1.7.1.
0.8.9+2
- Fixes new lint warnings.
0.8.9+1
- Updates plugin and example Gradle versions to 7.6.3.
0.8.9
- Fixes resizing bug and updates rounding to be more accurate.
- Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
0.8.8+2
- Updates annotations lib to 1.7.0.
0.8.8+1
- Fixes NullPointerException on pre-Android 13 devices when using Android Photo Picker to pick image or video.
0.8.8
- Adds additional category II and III exif tags to be copied during photo resize.
0.8.7+5
- Adds pub topics to package metadata.
- Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
0.8.7+4
- Updates the example to use the latest versions of the platform interface APIs.
0.8.7+3
- Bumps androidx.activity:activity from 1.7.1 to 1.7.2.
0.8.7+2
- Fixes a crash case when picking an image with a display name that does not contain a period.
0.8.7+1
- Bumps org.jetbrains.kotlin:kotlin-bom from 1.8.21 to 1.8.22.
0.8.7
- Adds
getMediamethod.
0.8.6+20
- Bumps androidx.activity:activity from 1.7.0 to 1.7.1.
0.8.6+19
- Bumps androidx.core:core from 1.9.0 to 1.10.1.
0.8.6+18
- Bumps org.jetbrains.kotlin:kotlin-bom from 1.8.10 to 1.8.21.
0.8.6+17
- Moves disk accesses to background thread.
0.8.6+16
- Fixes crashes caused by
SecurityExceptionwhen callinggetPathFromUri().
0.8.6+15
- Bumps androidx.activity:activity from 1.6.1 to 1.7.0.
0.8.6+14
- Fixes Java warnings.
0.8.6+13
- Fixes
BuildContexthandling in example.
0.8.6+12
- Improves image resizing performance by decoding Bitmap only when needed.
0.8.6+11
- Updates gradle to 7.6.1.
- Updates gradle, AGP and fixes some lint errors.
0.8.6+10
- Offloads picker result handling to separate thread.
0.8.6+9
- Fixes compatibility with AGP versions older than 4.2.
0.8.6+8
- Adds a namespace for compatibility with AGP 8.0.
0.8.6+7
- Fixes handling of non-bitmap image types.
- Updates minimum Flutter version to 3.3.
0.8.6+6
- Bumps androidx.core:core from 1.8.0 to 1.9.0.
0.8.6+5
- Fixes case when file extension returned from the OS does not match its real mime type.
0.8.6+4
- Bumps androidx.exifinterface:exifinterface from 1.3.3 to 1.3.6.
0.8.6+3
- Switches to Pigeon for internal implementation.
0.8.6+2
- Fixes null pointer exception in
saveResult.
0.8.6+1
- Refactors code in preparation for adopting Pigeon.
0.8.6
- Adds
usePhotoPickerAndroidoptions.
0.8.5+10
- Clarifies explanation of endorsement in README.
- Aligns Dart and Flutter SDK constraints.
0.8.5+9
- Fixes compilation warnings.
- Updates compileSdkVersion to 33.
0.8.5+8
- Adds Android 13 photo picker functionality if SDK version is at least 33.
- Bumps compileSdkVersion from 31 to 33
0.8.5+7
- Updates links for the merge of flutter/plugins into flutter/packages.
0.8.5+6
- Updates minimum Flutter version to 3.0.
- Fixes names of picked files to match original filenames where possible.
0.8.5+5
- Updates code for stricter lint checks.
0.8.5+4
- Fixes null cast exception when restoring a cancelled selection.
0.8.5+3
- Updates minimum Flutter version to 2.10.
- Bumps gradle from 7.1.2 to 7.2.1.
0.8.5+2
- Updates
image_picker_platform_interfaceconstraint to the correct minimum version.
0.8.5+1
- Switches to an internal method channel implementation.
0.8.5
- Updates gradle to 7.1.2.
0.8.4+13
- Minor fixes for new analysis options.
0.8.4+12
- Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors lint warnings.
0.8.4+11
- Splits from
image_pickeras a federated implementation.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'image_picker_android:0.8.13+25'pubspec.yaml
name: image_picker_android
description: Android implementation of the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.13+25
environment:
sdk: ^3.12.0
flutter: ">=3.44.0"
flutter:
plugin:
implements: image_picker
platforms:
android:
package: io.flutter.plugins.imagepicker
pluginClass: ImagePickerPlugin
dartPluginClass: ImagePickerAndroid
dependencies:
flutter:
sdk: flutter
flutter_plugin_android_lifecycle: ^2.0.1
image_picker_platform_interface: ^2.11.0
meta: ^1.10.0
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.4
pigeon: ^27.3.2
topics:
- camera
- image-picker
- files
- file-selection
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.8.4+11 | On demand | Download | 3ebd6bb2…fca4fe |
| 0.8.4+12 | On demand | Download | eeea01d2…8286a8 |
| 0.8.4+13 | On demand | Download | 524c04b8…43a276 |
| 0.8.5 | On demand | Download | 08cfcbf6…87d651 |
| 0.8.5+1 | On demand | Download | 2d4c2634…cd853c |
| 0.8.5+2 | On demand | Download | 8243d332…67def9 |
| 0.8.5+3 | On demand | Download | 822f71a5…68648a |
| 0.8.5+4 | On demand | Download | b2271807…167b82 |
| 0.8.5+5 | On demand | Download | b1cbfec0…3f7368 |
| 0.8.5+6 | On demand | Download | 385f12ee…d21f1d |
| 0.8.5+7 | On demand | Download | 68d067ba…beb344 |
| 0.8.5+8 | On demand | Download | 845f7938…98cc16 |
| 0.8.5+9 | On demand | Download | ca14b663…71225a |
| 0.8.5+10 | On demand | Download | 76730007…5fa67a |
| 0.8.6 | On demand | Download | 1f5a4b38…2b5101 |
| 0.8.6+1 | On demand | Download | 420ed22d…1ae669 |
| 0.8.6+2 | On demand | Download | 9c277637…2ba794 |
| 0.8.6+3 | On demand | Download | 52a1ac88…e3f6f1 |
| 0.8.6+4 | On demand | Download | 42b2f33d…19b1d2 |
| 0.8.6+5 | On demand | Download | b81db5f5…da4d4c |
| 0.8.6+6 | On demand | Download | dfb5b0f2…f212a7 |
| 0.8.6+7 | On demand | Download | 1ea68703…4f269c |
| 0.8.6+8 | On demand | Download | a07e3c11…8d5fce |
| 0.8.6+9 | On demand | Download | 4ffaf537…8d6823 |
| 0.8.6+10 | On demand | Download | 7d2b25e0…ac68fe |
| 0.8.6+11 | On demand | Download | 271e0448…b10da2 |
| 0.8.6+12 | On demand | Download | cc3e183c…f487be |
| 0.8.6+13 | On demand | Download | 794f9108…2af51f |
| 0.8.6+14 | On demand | Download | 89ba2aa6…5b77ed |
| 0.8.6+15 | On demand | Download | 364967c8…f7501c |
| 0.8.6+16 | On demand | Download | c2f3c664…046e59 |
| 0.8.6+17 | On demand | Download | 80dd8979…92e59f |
| 0.8.6+18 | On demand | Download | eda1d53c…ae16af |
| 0.8.6+19 | On demand | Download | 3083c3a3…601692 |
| 0.8.6+20 | On demand | Download | 1ec68302…6b4bd8 |
| 0.8.7 | On demand | Download | 216dbfb6…a6d922 |
| 0.8.7+1 | On demand | Download | 0d6d8d04…26d619 |
| 0.8.7+2 | On demand | Download | 9d5dac72…3657f6 |
| 0.8.7+3 | On demand | Download | d2bab152…a475bb |
| 0.8.7+4 | On demand | Download | 8179b540…05ca34 |
| 0.8.7+5 | On demand | Download | d32a997b…a0462d |
| 0.8.8 | On demand | Download | 47da2161…9cb369 |
| 0.8.8+1 | On demand | Download | 0c7b83bb…937ff2 |
| 0.8.8+2 | On demand | Download | d6a6e788…a4957f |
| 0.8.9 | On demand | Download | dae8aa23…2ada2d |
| 0.8.9+1 | On demand | Download | ecdc963d…a396fe |
| 0.8.9+2 | On demand | Download | 1a27bf4c…7759ec |
| 0.8.9+3 | On demand | Download | 39f2bfe4…7b51b1 |
| 0.8.9+5 | On demand | Download | 42c098e7…9f4321 |
| 0.8.9+6 | On demand | Download | 844c6da4…967a58 |
| 0.8.10 | On demand | Download | 8e75431a…7c4cb9 |
| 0.8.11 | On demand | Download | 40e24f46…2398c8 |
| 0.8.12 | On demand | Download | 79455f6c…b98370 |
| 0.8.12+1 | On demand | Download | 0f57fee1…1a19f1 |
| 0.8.12+2 | On demand | Download | c01a23e2…81ca33 |
| 0.8.12+3 | On demand | Download | 4161e1f8…b7b51c |
| 0.8.12+4 | On demand | Download | ff39a10a…2c25db |
| 0.8.12+5 | On demand | Download | 9e32a194…71f147 |
| 0.8.12+6 | On demand | Download | cea2bd5b…8eeb7f |
| 0.8.12+7 | On demand | Download | a26dc9a0…a81889 |
| 0.8.12+8 | On demand | Download | 8c316846…60393e |
| 0.8.12+9 | On demand | Download | 1b65687c…b528f9 |
| 0.8.12+10 | On demand | Download | 3fe99e3a…26ec87 |
| 0.8.12+11 | On demand | Download | c0e72ecd…c5db4b |
| 0.8.12+12 | On demand | Download | 8c5abf0d…a70f56 |
| 0.8.12+13 | On demand | Download | c0a6763d…05cc85 |
| 0.8.12+14 | On demand | Download | dbd24fc9…9655bb |
| 0.8.12+15 | On demand | Download | d3e5e00f…28e643 |
| 0.8.12+16 | On demand | Download | d34e0d9e…065d82 |
| 0.8.12+17 | On demand | Download | 8faba09b…86bd32 |
| 0.8.12+18 | On demand | Download | fa814160…2c193e |
| 0.8.12+19 | On demand | Download | aa6f1280…c5e59f |
| 0.8.12+20 | On demand | Download | b62d34a5…08ee0c |
| 0.8.12+21 | On demand | Download | 82652a75…e5e89a |
| 0.8.12+22 | On demand | Download | 8bd392ba…f090e9 |
| 0.8.12+23 | On demand | Download | 317a5d96…b9ebeb |
| 0.8.12+24 | On demand | Download | 6fae381e…b80c8d |
| 0.8.12+25 | On demand | Download | b08e9a04…a7ccd6 |
| 0.8.13 | On demand | Download | e83b2b05…60050c |
| 0.8.13+1 | On demand | Download | 28f3987c…5cfa6e |
| 0.8.13+2 | On demand | Download | a45bef33…7cdd52 |
| 0.8.13+3 | On demand | Download | 8dfe08ea…32cd02 |
| 0.8.13+4 | On demand | Download | dd7a61da…cac0dc |
| 0.8.13+5 | On demand | Download | 58a85e6f…18efca |
| 0.8.13+7 | On demand | Download | ca2a3b04…0056f6 |
| 0.8.13+8 | On demand | Download | a1cd1584…adcabe |
| 0.8.13+9 | On demand | Download | 788167bc…a8de40 |
| 0.8.13+10 | On demand | Download | 5e9bf126…224677 |
| 0.8.13+11 | On demand | Download | 539e0030…a139d7 |
| 0.8.13+12 | On demand | Download | 297e42bd…f7e6a1 |
| 0.8.13+13 | On demand | Download | 518a1610…2e703d |
| 0.8.13+14 | On demand | Download | eda9b91b…a86156 |
| 0.8.13+15 | On demand | Download | 9eae0cbd…b0d3fd |
| 0.8.13+16 | On demand | Download | 66810af8…8c6622 |
| 0.8.13+17 | On demand | Download | d5b3e177…14793f |
| 0.8.13+18 | On demand | Download | 695b6a97…5e36af |
| 0.8.13+19 | On demand | Download | 6f3a1995…4df84a |
| 0.8.13+21 | On demand | Download | f71f4f3a…13b72a |
| 0.8.13+22 | On demand | Download | 1c0c3879…81cf54 |
| 0.8.13+23 | On demand | Download | 0a55d645…1e7219 |
| 0.8.13+25 | Cached · Upstream SHA-256 matched | Download | 8a7823d5…a912d4 |
Dependencies
flutter {
"sdk": "flutter"
}
flutter_plugin_android_lifecycle "^2.0.1"
image_picker_platform_interface "^2.11.0"
meta "^1.10.0"