dart-build-cli-app
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface…
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.
Claude Code
$ npx -y skills add flutter/agent-plugins --skill dart-add-unit-test --agent claude-code
Codex
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a codex -y
Cursor
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a cursor -y
Gemini CLI
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a gemini-cli -y
GitHub Copilot
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a github-copilot -y
OpenCode
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a opencode -y
Windsurf
$ npx skills add flutter/agent-plugins --skill dart-add-unit-test -a windsurf -y
name: dart-add-unit-test description: Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free. metadata: model: models/gemini-3.1-pro-preview last_modified: Mon, 03 Aug 2026 21:51:24 GMT
Organize test files to mirror the `lib` directory structure to maintain predictability.
Utilize `package:test` as the standard testing library for Dart applications.
Select the appropriate test runner based on the project type and test location.
Follow this sequential workflow when implementing new test suites. Copy the checklist to track your progress.
Demonstrates grouping, setup, synchronous, and asynchronous testing.
import 'package:test/test.dart';
import 'package:my_package/calculator.dart';
void main() {
group('Calculator', () {
late Calculator calc;
setUp(() {
calc = Calculator();
});
test('adds two numbers correctly', () {
expect(calc.add(2, 3), equals(5));
});
test('handles asynchronous operations', () async {
final result = await calc.fetchRemoteValue();
expect(result, isNotNull);
expect(result, greaterThan(0));
});
});
}Demonstrates configuring a mock object for dependency injection testing.
import 'package:test/test.dart';
import 'package:mockito/mockito.dart';
import 'package:mockito/annotations.dart';
import 'package:my_package/api_client.dart';
import 'package:my_package/data_service.dart';
// Generate the mock using build_runner: dart run build_runner build
@GenerateNiceMocks([MockSpec<ApiClient>()])
import 'data_service_test.mocks.dart';
void main() {
group('DataService', () {
late MockApiClient mockApiClient;
late DataService dataService;
setUp(() {
mockApiClient = MockApiClient();
dataService = DataService(apiClient: mockApiClient);
});
test('returns parsed data on successful API call', () async {
// Configure the mock
when(mockApiClient.get('/data')).thenAnswer((_) async => '{"id": 1}');
// Execute the system under test
final result = await dataService.fetchData();
// Verify outcomes and interactions
expect(result.id, equals(1));
verify(mockApiClient.get('/data')).called(1);
});
});
}Agent plugins for Flutter, maintained by the Flutter team. A collection of plugins designed to extend AI agent capabilities for Flutter development.
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.
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.