pubspec

Solid

Opinionated pubspec.yaml standards for Flutter apps — unconstrained versions pinned by the lock file, a pub.dev URL comment per package, dependencies vs dev_dependencies, SDK constraints, and code-gen packages. Auto-applies when editing pubspec.yaml or pubspec.lock.

AI & Automation 1 stars 0 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# pubspec & Dependency Management `flutter pub get` and `pubspec.lock` own version resolution. Keep `pubspec.yaml` declarative and uncluttered. ## Adding dependencies - **Ask first.** Never add a new package (to `dependencies` or `dev_dependencies`) without the user's explicit consent — name the package, its pub.dev link, and what it's for, then wait for a yes. - Add the package with **no version constraint** — `flutter pub get` resolves it and `pubspec.lock` pins it. - Add a `# https://pub.dev/packages/<name>` comment above every package. - `dependencies:` for packages shipped in the app; `dev_dependencies:` for build tools and test packages (`build_runner`, `mockito`, `import_sorter`, `dependency_validator`, `flutter_lints`). ```yaml dependencies: # https://pub.dev/packages/get get: # https://pub.dev/packages/equatable equatable: dev_dependencies: # https://pub.dev/packages/build_runner build_runner: ``` After editing, sync and commit both files together: ```bash flutter pub get git add pubspec.yaml pubspec.lock # commit: "deps: add <package>" ``` ## Rules - Never edit `pubspec.lock` by hand — it is generated by `flutter pub get`. - SDK constraints live under `environment:`; don't change them without testing on both iOS and Android. - Every imported package must be declared here — `dependency_validator` enforces it (whitelist false positives in `dart_dependency_validator.yaml`). - Check for updates with `flutter pub outdated`. ## Code-g...

Details

Author
virajp
Repository
virajp/ai-plugins
Created
2 months ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category