Skip to content

[image_picker] moves Android 13 image picker to options - #3370

Merged
auto-submit[bot] merged 23 commits into
flutter:mainfrom
tarrinneal:ip-flag
Mar 9, 2023
Merged

auto-submit[bot] merged 23 commits into
flutter:mainfrom
tarrinneal:ip-flag

Conversation

@tarrinneal

Copy link
Copy Markdown
Contributor

Since the newest Android image picker doesn't yet support cloud files, I've moved it to an optional parameter for now.
This will allow users to maintain their cloud access while still allowing the people who want to use the new picker to do so as well.

fixes flutter/flutter#121744

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Comment thread packages/image_picker/image_picker/lib/image_picker.dart Outdated

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than have this Android-specific option in all of the APIs, I would rather we restrict this to the Android package. Since I doubt anyone is going to want different versions for different calls within the same app, the simplest option for clients would be a class-level setting, which we can put on the Android implementation in this case.

See https://pub.dev/packages/google_maps_flutter_android#display-mode for an example of what a platform class option looks like.

@tarrinneal

Copy link
Copy Markdown
Contributor Author

Rather than have this Android-specific option in all of the APIs, I would rather we restrict this to the Android package. Since I doubt anyone is going to want different versions for different calls within the same app, the simplest option for clients would be a class-level setting, which we can put on the Android implementation in this case.

See https://pub.dev/packages/google_maps_flutter_android#display-mode for an example of what a platform class option looks like.

This is very helpful, thank you

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good at the Android package level. I left a comment about the wrapper API in the app-facing package, which we should remove. I apparently picked the worst example to point you to without realizing it :(

Unfortunately the implementation-package-specific APIs are still relatively new territory in our plugin development, so things aren't as consistent as they could be yet.

Comment thread packages/image_picker/image_picker/lib/image_picker.dart Outdated
Comment thread packages/image_picker/image_picker_ios/pubspec.yaml Outdated
Comment thread packages/image_picker/image_picker_android/pubspec.yaml Outdated
@tarrinneal
tarrinneal marked this pull request as ready for review March 8, 2023 01:15
@tarrinneal
tarrinneal requested a review from gmackall as a code owner March 8, 2023 01:15
@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 9, 2023
@auto-submit
auto-submit Bot merged commit 3814ec4 into flutter:main Mar 9, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 9, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 9, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
[image_picker] moves Android 13 image picker to options
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request May 30, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a media-only gallery instead of a
general file browser on certain Android versions, which allowed
the user to pick non-media files. The package leaves this off by
default to preserve access to cloud providers via the legacy picker.
See:
  https://flutter/packages#3370

For details regarding affected Android versions, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 1, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a media-only gallery instead of a
general file browser on certain Android versions, which allowed
the user to pick non-media files. The package leaves this off by
default to preserve access to cloud providers via the legacy picker.
See:
  https://flutter/packages#3370

For details regarding affected Android versions, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 1, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 1, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 1, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 5, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 5, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behaviour according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 5, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 6, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 6, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
[image_picker] moves Android 13 image picker to options
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
[image_picker] moves Android 13 image picker to options
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 19, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 19, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jun 28, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 4, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 4, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 9, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 9, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Ruhdee added a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 10, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
chrisbobbe pushed a commit to Ruhdee/zulip-flutter that referenced this pull request Jul 10, 2026
Fixes zulip#1490.

This change sets 'ImagePickerAndroid.useAndroidPhotoPicker' to true
so that 'pickMultipleMedia' shows a photo and video-only gallery
instead of a general file browser on certain Android versions,
which allowed the user to pick non-media files. The package leaves
this off by default to preserve access to cloud providers via the
legacy picker. See:
  flutter/packages#3370

For details regarding behavior according to Android version, see:
  https://pub.dev/packages/image_picker_android
  flutter/packages#11320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: image_picker platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[image_picker] No longer able to select photos from Google Photos

3 participants