Skip to content

Make ordered selection optional in the iOS photo picker - #2242

Merged
vicajilau merged 6 commits into
mainfrom
feat/darwin-ordered-selection-option
Oct 11, 2026
Merged

vicajilau merged 6 commits into
mainfrom
feat/darwin-ordered-selection-option

Conversation

@vicajilau

Copy link
Copy Markdown
Owner

Fixes #2241

Problem

Since 12.x the iOS photo library picker always uses PHPickerConfiguration.Selection.ordered, added in #2047 to keep the results in selection order (#1866). Ordered selection also disables selecting several items by swiping across the grid, so users have to tap every photo one by one, which is a real regression for apps that pick many photos at once.

#2047 made two changes: it stores the results by index, which keeps them in the order PHPicker returns them, and it enables .ordered. Only .ordered is documented to return the results in the order the user selected them, so simply removing it could bring #1866 back.

Change

  • New DarwinOptions.orderedSelection, true by default, so the selection order keeps being guaranteed and nothing changes for existing apps.
  • IOSFilePickerHandler only applies .ordered when it is enabled. Apps that do not care about the order can set it to false to restore swipe to select.
  • README section next to the photo library asset representation one, and a toggle in the example.

file_picker_platform_interface 4.1.0 (new field) and file_picker_darwin 2.2.0, which raises its interface lower bound to ^4.1.0.

Testing

  • New tests for the default value and for the option being sent over the method channel, true by default and false when disabled, for both pickFile() and pickFiles().
  • Analysis is clean across the workspace and the example builds for the iOS simulator.
  • PHPicker cannot be driven from tests, so this still needs a manual check: with the toggle on, swipe to select stays disabled and the photos come back in selection order, and with it off, swipe to select works.

The photo library picker always used PHPickerConfiguration.Selection.ordered, added in #2047 to keep results in selection order. Ordered selection also disables selecting several items by swiping across the grid, so users of apps that pick many photos have to tap each one.

Add DarwinOptions.orderedSelection, true by default so the order keeps being guaranteed, and only apply .ordered when it is enabled. Apps that do not care about the order can set it to false to restore swipe to select. The example gets a toggle for it.

Bumps file_picker_platform_interface to 4.1.0 and file_picker_darwin to 2.2.0.

Fixes #2241
The doc said it had no effect with the iOS document picker, which does not tell which FileType uses which picker. Name image, video and media, the types that go through the photo library picker.
79efba3 picked up a local DEVELOPMENT_TEAM change to the example's Xcode project by accident.
@vicajilau

Copy link
Copy Markdown
Owner Author

Heads up @navaronbracke: could #2244 land before this one? Both bump file_picker_darwin (2.1.4 there, 2.2.0 here), and #2244 is a bug fix that can ship on its own. Once it's in, I'll bring main into this branch so the changelog reads 2.2.0 on top of 2.1.4. Thanks! 🙂

Comment thread packages/file_picker_darwin/test/file_picker_darwin_test.dart Outdated
Comment thread packages/file_picker_darwin/test/file_picker_darwin_test.dart
Comment thread packages/file_picker_darwin/CHANGELOG.md Outdated
vicajilau and others added 3 commits October 11, 2026 09:50
Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
Rename the remaining uses of the test variable to orderedSelection, following the suggestion applied in 0165068, cover pickFile() with the default options, and drop the redundant interface lower bound line from the changelog.
# Conflicts:
#	packages/file_picker_darwin/CHANGELOG.md
#	packages/file_picker_darwin/pubspec.yaml
@vicajilau
vicajilau merged commit 2e02dca into main Oct 11, 2026
18 checks passed
@vicajilau
vicajilau deleted the feat/darwin-ordered-selection-option branch October 11, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] configuration.selection = .ordered disables swipe-to-select in media picker

2 participants