Skip to content

Conversation

behzodfaiziev
Copy link

@behzodfaiziev behzodfaiziev commented Jun 10, 2025

This PR fixes the incorrect handling of the limit parameter in the pickMultiImage method of the image_picker package. Previously, the limit option was not respected across all platforms (Android, iOS, Web), allowing users to select more images than specified.

With this change, the image selection is now properly limited according to the provided limit value, ensuring that only the requested number of images are returned.

Fixes: flutter/flutter#170361

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • 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 [linked to 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 I have commented below to indicate which [version change exemption] this PR falls under[^1].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style], or I have commented below to indicate which [CHANGELOG exemption] this PR falls under[^1].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@behzodfaiziev behzodfaiziev changed the title fix(image_picker): Add limit parameter in pickMultiImage [image_picker]: Add limit parameter in pickMultiImage Jun 10, 2025
@stuartmorgan-g
Copy link
Collaborator

Please see https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-platform-interface-method-parameters to understand how we evolve platform interface APIs. Closing, as making a breaking change to the platform interface to add a parameter that we have already added using our documented, non-breaking process is not a change we would accept.

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

Successfully merging this pull request may close these issues.

pickMultiImage's limit parameter is not respected
2 participants