Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[image_picker] Adds comment for the limit parameter #6678

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LinXunFeng
Copy link
Member

Fixes flutter/flutter#147773

Pre-launch Checklist

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

@@ -112,6 +112,12 @@ class ImagePicker {
/// image types such as JPEG and on Android PNG and WebP, too. If compression is not
/// supported for the image that is picked, a warning message will be logged.
///
/// The `limit` parameter modifies the maximum number of images that can be selected.
/// On Android, you need to set ImagePickerAndroid's useAndroidPhotoPicker to
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be [] around ImagePickerAndroid, and `` around useAndroidPhotoPicker

This also seems a little verbose, maybe shorten it to

On Android, [ImagePickerAndroid.useAndroidPhotoPicker] must be set to `true` to use the `limit` functionality

I'm not sure the see: [link] part is necessary either.

Same for the other instance of this comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review, I've readjusted it.

@tarrinneal
Copy link
Contributor

I guess, before this gets merged, is this a feature that isn't available in the android sdk? or is it just not implemented properly in the plugin?

@LinXunFeng
Copy link
Member Author

I made a reply here(flutter/flutter#147773 (comment)) and adjusted the comment. Please review again.

/// On Android, [ImagePickerAndroid.useAndroidPhotoPicker] must be set to `true`
/// to use the `limit` functionality. And it can only be ensured to take effect
/// on Android 13 or above. Otherwise, it depends on whether the corresponding
/// system app supports it.
Copy link
Contributor

Choose a reason for hiding this comment

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

We do not generally get this specific about platform-specific details in the app-facing package:

  • They tend to get outdated because they are about details that are controlled in another package.
  • They don't scale well to many platforms (e.g., you haven't discussed desktop here, and specifically calling out only Android makes it seem like desktop should be fine, which isn't the case).
  • They can't scale to third-party implementations.

I would much prefer we just use the same comment that we use for the platform interface layer.

This level of platform-specific detail is something we could put in the Android package's README.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants