accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions,…
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
Claude Code
$ npx -y skills add evanca/flutter-ai-rules --skill mocktail --agent claude-code
Codex
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a codex -y
Cursor
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a cursor -y
Gemini CLI
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a gemini-cli -y
GitHub Copilot
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a github-copilot -y
OpenCode
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a opencode -y
Windsurf
$ npx skills add evanca/flutter-ai-rules --skill mocktail -a windsurf -y
name: mocktail description: "Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail)." license: MIT
This skill defines how to correctly use the `mocktail` package for mocking in Dart and Flutter tests.
---
| Use | When | |---|---| | **Real object** | Prefer over mocks when practical. | | **Fake** (`extends Fake`) | Lightweight custom implementation; override only the methods you need. Prefer over mocks when you don't need interaction verification. | | **Mock** (`extends Mock`) | Only when you need to **verify interactions** (call counts, arguments) or stub dynamic responses. |
---
class MockMyService extends Mock implements MyService {}
class FakeMyEvent extends Fake implements MyEvent {}No code generation required — unlike Mockito, Mocktail uses `noSuchMethod` at runtime.
---
Register fallback values **before** using custom types with argument matchers. Do this in `setUpAll` or at the top of your test:
setUpAll(() {
registerFallbackValue(FakeMyEvent());
});---
final mock = MockMyService();
// Return a value
when(() => mock.fetchData()).thenReturn('result');
// Throw an error
when(() => mock.fetchData()).thenThrow(Exception('error'));
// Dynamic/async response
when(() => mock.fetchData()).thenAnswer((_) async => 'result');
// Future<void>
when(() => mock.doWork()).thenAnswer((_) async {});---
Always include **all named parameters** in both `when` and `verify` calls. Use `any(named: 'paramName')` for those you don't care about:
when(() => mock.fetch( id: any(named: 'id'), headers: any(named: 'headers'), )).thenReturn(response);
---
verify(() => mock.fetchData()); // called at least once verifyNever(() => mock.fetchData()); // never called verify(() => mock.fetchData()).called(2); // called exactly twice
---
// Any positional argument when(() => mock.process(any())).thenReturn(true); // Capture arguments for later assertions final captured = verify(() => mock.process(captureAny())).captured; print(captured.last);
---
36 Flutter and Dart skills your coding agent loads by itself, sourced only from official documentation. A skill is a folder with a SKILL.md file.
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions,…
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection,…
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring…
Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring…
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or…
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.