flutter/docs/unsorted_wiki/Updating-dependencies-in-Flutter.md
Kate Lovett ed8eaf1b84
Migrate the flutter/flutter wiki to docs/unsorted_wiki (#148562)
Part of https://github.com/flutter/flutter/issues/145009
This is part one of the wiki migration.
This moves all wiki pages wholesale into the new docs directory with no changes.
Follow up PRs will sort them, updating breadcrumbs and links.
2024-05-17 22:12:18 +00:00

1.1 KiB

Instead of manually updating dependencies in a pubspec.yaml file, use the update-packages 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 and a 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.

In that case, you can run:

flutter update-packages --cherry-pick-package=[pub package name] --cherry-pick-version='[pub package version]'