Skip to content

[hooks] Remove unused meta dependency (fixes Flutter compat) - #3553

Merged
dcharkes merged 1 commit into
dart-lang:mainfrom
brucearctor:fix/hooks-remove-unused-meta-dep
Aug 14, 2026
Merged

[hooks] Remove unused meta dependency (fixes Flutter compat)#3553
dcharkes merged 1 commit into
dart-lang:mainfrom
brucearctor:fix/hooks-remove-unused-meta-dep

Conversation

@brucearctor

Copy link
Copy Markdown
Contributor

Problem

The hooks package lists meta: ^1.19.0 as a dependency but never imports package:meta anywhere in its lib/ or test/ directories.

This unused dependency causes version conflicts for Flutter packages that use build hooks:

Because my_package depends on hooks ^2.1.0 which depends on meta ^1.19.0,
every version of my_package requires meta ^1.19.0.
And because every version of flutter_test from sdk depends on meta 1.17.0,
my_package is incompatible with flutter_test from sdk.

Flutter stable (3.41.9, Dart 3.11.5) pins meta 1.17.0 via flutter_test. Since pub.dev enforces that hook/ imports must be in dependencies (not dev_dependencies), there is no workaround — any Flutter package using build hooks is blocked.

Verification

# Zero imports of package:meta in hooks lib/ or test/
$ grep -rn "import.*package:meta" pkgs/hooks/lib/ pkgs/hooks/test/ --include='*.dart'
# (no output)

Note: hooks_runner legitimately uses package:meta — this PR only removes it from hooks.

Fix

Remove meta: ^1.19.0 from pkgs/hooks/pubspec.yaml dependencies.

Fixes #3551

The `hooks` package lists `meta: ^1.19.0` as a dependency but
never imports `package:meta` anywhere in `lib/` or `test/`.

This unused dependency causes version conflicts for Flutter packages
that use build hooks, because Flutter stable (3.41.9) pins
`meta 1.17.0` via `flutter_test`, which is incompatible with
`meta ^1.19.0`.

Fixes dart-lang#3551
@dcharkes

dcharkes commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

I suppose we removed @experimental or something similar and are now no longer using it. 👍

(And we bumped to 1.19 in this repo due to @RecordUse() and @mustBeConst from package:meta no longer being experimental in that version.)

@dcharkes
dcharkes merged commit ae2fa39 into dart-lang:main Aug 14, 2026
35 of 36 checks passed
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.

hooks ^2.1.0 requires meta ^1.19.0 — incompatible with Flutter stable

2 participants