dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
Claude Code
$ npx -y skills add flutter/agent-plugins --skill dart-resolve-package-conflicts --agent claude-code
Codex
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a codex -y
Cursor
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a cursor -y
Gemini CLI
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a gemini-cli -y
GitHub Copilot
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a github-copilot -y
OpenCode
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a opencode -y
Windsurf
$ npx skills add flutter/agent-plugins --skill dart-resolve-package-conflicts -a windsurf -y
name: dart-resolve-package-conflicts description: Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions. metadata: model: models/gemini-3.1-pro-preview last_modified: Fri, 24 Apr 2026 15:11:14 GMT
Dart enforces a strict single-version rule for dependencies: a project and all its transitive dependencies must resolve to a single, shared version of any given package. This prevents runtime type mismatches but introduces the risk of "version lock."
To mitigate version lock, Dart relies on version constraints rather than pinned versions in the `pubspec.yaml`. The `pubspec.lock` file maintains the exact resolved versions for reproducible builds.
Understand the output columns of `dart pub outdated`:
Run this workflow periodically to identify stale packages that may impact stability or performance.
**Task Progress:**
Use conditional logic based on the audit results to upgrade dependencies.
**Task Progress:**
When `pub` cannot find a set of concrete versions that satisfy all constraints, or when dealing with a retracted package version, manipulate the lockfile surgically.
**NEVER** delete the entire `pubspec.lock` file and run `dart pub get`. This causes uncontrolled upgrades across the entire dependency graph.
**Task Progress:**
When `dart pub outdated` shows a package is resolvable to a higher minor/patch version, use the `--tighten` flag to update the `pubspec.yaml` automatically.
**Input (`pubspec.yaml`):**
dependencies: http: ^0.13.0
**Command:**
dart pub upgrade --tighten http
**Output (`pubspec.yaml`):**
dependencies: http: ^0.13.5
If `package_a` is retracted or locked in a conflict, remove only its block from `pubspec.lock`.
**Before (`pubspec.lock`):**
packages:
package_a:
dependency: "direct main"
description:
name: package_a
url: "https://pub.dev"
source: hosted
version: "1.0.0" # Retracted version
package_b:
dependency: "direct main"
# ...**Action:** Delete the `package_a` block entirely. Leave `package_b` untouched. Run `dart pub get`.
Agent plugins for Flutter, maintained by the Flutter team. A collection of plugins designed to extend AI agent capabilities for Flutter development.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface…
Collect coverage using the coverage packge and create an LCOV report
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via…
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing…
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.