Updates pinned package dependencies for Dart and Flutter project templates. Use when adding/removing packages from the allowlist or updating dependency versions across Flutter channels (main/beta/stable).
Copy this checklist and track your progress:
Dependency Update Progress:
- [ ] Step 1: Update allowlist (if adding/removing packages)
- [ ] Step 2: Update Stable channel
- [ ] Step 3: Update Beta channel
- [ ] Step 4: Update Main channel
If adding or removing packages, edit lib/src/project_templates.dart first. This file contains the allowlist of supported packages. Skip this step if only updating versions.
/!\ Repeat these steps for each channel (stable, beta, main) /!\
flutter channel <CHANNEL>
flutter upgrade
dart tool/grind.dart build-project-templates
[!NOTE] If this fails due to resolution errors:
- Read the error message to identify the conflict.
- Edit
tool/dependencies/pub_dependencies_<CHANNEL>.jsonto fix the version.- Retry the build command.
Navigate to the generated project templates and upgrade dependencies:
cd project_templates/dart_project && flutter pub upgrade && cd ../..
cd project_templates/flutter_project && flutter pub upgrade && cd ../..
Overwrite the pub_dependencies_<CHANNEL>.json file with the resolved versions:
dart tool/grind.dart update-pub-dependencies