dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
Claude Code
$ npx -y skills add flutter/agent-plugins --skill dart-fix-runtime-errors --agent claude-code
Codex
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a codex -y
Cursor
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a cursor -y
Gemini CLI
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a gemini-cli -y
GitHub Copilot
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a github-copilot -y
OpenCode
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a opencode -y
Windsurf
$ npx skills add flutter/agent-plugins --skill dart-fix-runtime-errors -a windsurf -y
name: dart-fix-runtime-errors description: Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload. metadata: model: models/gemini-3.1-pro-preview last_modified: Fri, 24 Apr 2026 15:13:22 GMT
Enforce Dart's sound type system to prevent runtime invalid states.
Eliminate static errors related to null safety by correctly managing variable initialization and nullability.
Distinguish between recoverable exceptions and unrecoverable errors.
Use this sequential workflow to identify, fix, and verify static analysis errors in a Dart project. Copy the checklist to track your progress.
**Task Progress:**
**1. Run static analyzer** Execute the Dart analyzer to identify all static errors in the target directory or file.
dart analyze . --fatal-infos
**2. Apply automated fixes** Use the `dart fix` tool to automatically resolve standard linting and analysis issues.
# Preview changes dart fix --dry-run # Apply changes dart fix --apply
**3. Resolve remaining errors manually** Review the remaining analyzer output and apply conditional logic based on the error type:
**4. Verify fixes (Feedback Loop)** Run the validator. Review errors. Fix.
dart analyze . dart test
**Input (Fails Static Analysis):**
void printInts(List<int> a) => print(a);
void main() {
final list = []; // Inferred as List<dynamic>
list.add(1);
list.add(2);
printInts(list); // Error: List<dynamic> can't be assigned to List<int>
}**Output (Passes Static Analysis):**
void printInts(List<int> a) => print(a);
void main() {
final list = <int>[]; // Explicitly typed
list.add(1);
list.add(2);
printInts(list);
}**Input (Fails Static Analysis):**
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(Mouse a) {} // Error: Tightening parameter type
}**Output (Passes Static Analysis):**
class Animal {
void chase(Animal a) {}
}
class Cat extends Animal {
@override
void chase(covariant Mouse a) {} // Explicitly marked covariant
}**Input (Fails Static Analysis):**
class Thermometer {
String temperature; // Error: Non-nullable instance field muAgent 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
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.
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
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.