Skip to content

feat(deps): migrate to file_picker 12 - #10

Merged
mpge merged 2 commits into
mainfrom
feat/file-picker-12
Aug 31, 2026
Merged

mpge merged 2 commits into
mainfrom
feat/file-picker-12

Conversation

@mpge

@mpge mpge commented Aug 31, 2026

Copy link
Copy Markdown
Member

Supersedes #9, and closes out the one major that PR #8 deliberately held back.

Dependabot's proposal cannot compile

#9 widens the constraint to >=8.0.0 <13.0.0 and changes nothing else. That range is unbuildable: file_picker broke the exact API this dropzone uses three separate times.

Version Break
v11 removed the FilePicker.platform instance getter; pickFiles became a static
v12 returns List<PlatformFile> directly instead of a nullable FilePickerResult wrapper — cancelling now yields an empty list, not null
v12 replaced PlatformFile.size (sync int) with length() (async)

Each one surfaced only after fixing the previous, so the migration is a little more than a rename — the size change in particular forces the mapping into a loop, since .map() cannot await.

This one pins rather than widens

PR #8 established the house style for this library: widen the upper bound so consumers can adopt a new major while the old one keeps working, which was right for go_router, shimmer and flutter_secure_storage because flutter analyze proved the whole range compiles.

file_picker is the opposite case, so it is set to ^12.1.2. A constraint spanning an API break is a promise the code cannot keep — a consumer resolving v8 inside >=8.0.0 <13.0.0 would get a package that does not build.

allowMultiple is deprecated in v12 and now defaults to true, which is what this dropzone wants, so it is dropped rather than passed.

Also worth noting: the null-path skip is now load-bearing rather than defensive. In v12 path is derived from a Uri and is null for non-local picks (blob/data URIs on web), so those files are skipped because there is nothing to upload from.

Verification

flutter analyze 0 errors — 83 infos, matching the pre-change baseline exactly — and flutter test 2/2, resolved against file_picker 12.1.2 (confirmed via flutter pub deps).

Standing caveat from #8 still applies: CI runs analyze but never flutter test, and the suite is 2 tests, so a file-picker dialog change like this leans on static analysis. There is no widget test covering FileDropzone; adding one would need the platform channel mocked, which is a bigger piece of work than this migration.

mpge added 2 commits August 31, 2026 15:39
Builds on the flutter_secure_storage widening in the previous commit,
keeping the same library-friendly shape: widen the upper bound so
consumers can adopt the new major while the old one stays supported,
rather than forcing everyone onto the newest.

- go_router ^14.0.0 -> '>=14.0.0 <19.0.0'  (resolves 18.0.0)
- shimmer ^3.0.0 -> '>=3.0.0 <5.0.0'       (resolves 4.0.0)
- flutter_lints ^3.0.1 -> '>=3.0.1 <7.0.0' (resolves 6.0.0)
- flutter_secure_storage upper bound 11 -> 12

example/ tracks the same ranges and the same sdk/flutter minimums so the
workspace resolves as one.

file_picker is deliberately NOT widened: v12 removes FilePicker.platform,
which lib/src/widgets/file_dropzone.dart:38 uses, so it needs a code
migration rather than a constraint change.

Verified with the widened ranges resolved to their upper end:
flutter analyze 0 errors (83 infos, one fewer than before) and
flutter test 2/2 passing.

Also bumps actions/checkout v5 -> v7 and adds .github/dependabot.yml
(pub for / and /example, plus github-actions); this repo had no
dependabot config at all.
Dependabot proposed widening the constraint to '>=8.0.0 <13.0.0'. That
range cannot compile: file_picker broke the exact API this dropzone uses
three separate times.

  v11  removed the FilePicker.platform instance getter and promoted
       pickFiles to a static
  v12  returns List<PlatformFile> directly instead of a nullable
       FilePickerResult wrapper, so cancelling yields an empty list
  v12  replaced PlatformFile.size (sync int) with length() (async)

So this one pins rather than widens, unlike go_router/shimmer/
flutter_secure_storage where analyze proved the whole range compiles. A
constraint spanning an API break is a promise the code cannot keep.

allowMultiple is deprecated in v12 and now defaults to true, which is
what the dropzone wants, so it is dropped rather than passed.

Verified: flutter analyze 0 errors (83 infos, matching the pre-change
baseline) and flutter test 2/2 passing, resolved against file_picker
12.1.2.
@mpge
mpge merged commit 2d535a4 into main Aug 31, 2026
1 check passed
@mpge
mpge deleted the feat/file-picker-12 branch August 31, 2026 21:05
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.

1 participant