aves_mio/.flutter/docs/infra/Updating-dependencies-in-Flutter.md
Fabio Micheluz 2c988f959b
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-02-19 13:25:23 +01:00

24 lines
1.1 KiB
Markdown

Instead of manually updating dependencies in a `pubspec.yaml` file, use the [`update-packages`](/packages/flutter_tools/lib/src/commands/update_packages.dart) CLI tool:
## To update all dependencies:
`flutter update-packages --force-upgrade`
## To pin a dependency:
Sometimes you need to prevent a dependency from being updated when you run `flutter update-packages --force-upgrade`.
In that case, first pin the dependency in [`kManuallyPinnedDependencies`](/packages/flutter_tools/lib/src/update_packages_pins.dart) and include a comment with a link to an issue to unpin the dependency.
You can then re-run `flutter update-packages --force-upgrade`.
## To update a single dependency for cherrypicks:
Sometimes you need to update a single dependency as a [cherrypick to a release candidate branch](../releases/Flutter-Cherrypick-Process.md).
In that case, you can run:
`flutter update-packages --cherry-pick=[pub package name]:[pub package version],[pub package2 name]:[pub package2 version]`
for example, to update the `test` dependencies, run
`flutter update-packages --cherry-pick=test_api:0.7.6,test_core:0.6.10,test:1.26.1`