accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions,…
Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito).
Claude Code
$ npx -y skills add evanca/flutter-ai-rules --skill mockito --agent claude-code
Codex
$ npx skills add evanca/flutter-ai-rules --skill mockito -a codex -y
Cursor
$ npx skills add evanca/flutter-ai-rules --skill mockito -a cursor -y
Gemini CLI
$ npx skills add evanca/flutter-ai-rules --skill mockito -a gemini-cli -y
GitHub Copilot
$ npx skills add evanca/flutter-ai-rules --skill mockito -a github-copilot -y
OpenCode
$ npx skills add evanca/flutter-ai-rules --skill mockito -a opencode -y
Windsurf
$ npx skills add evanca/flutter-ai-rules --skill mockito -a windsurf -y
name: mockito description: "Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito)." license: MIT
This skill defines how to correctly use the `mockito` 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. |
---
@GenerateMocks([MyClass])
// or for nice mocks (return simple legal values for missing stubs):
@GenerateNiceMocks([MockSpec<MyClass>()])
void main() { ... }dart run build_runner build
---
final mock = MockCat();
// Return a value
when(mock.sound()).thenReturn('Meow');
// Throw an error
when(mock.sound()).thenThrow(Exception('No sound'));
// Calculate response at call time
when(mock.sound()).thenAnswer((_) => computedValue);
// Return values in sequence
when(mock.sound()).thenReturnInOrder(['Meow', 'Purr']);---
verify(mock.sound()); // called at least once verifyNever(mock.eat(any)); // never called verify(mock.sound()).called(2); // called exactly twice
**Async:**
await untilCalled(mock.sound()); // wait for the interaction
---
// Flexible stubbing when(mock.eat(any)).thenReturn(true); when(mock.eat(argThat(isNotNull))).thenReturn(true); // Named arguments when(mock.fetch(any, headers: any)).thenReturn(response);
---
final captured = verify(mock.eat(captureAny)).captured; print(captured.last); // last captured argument
Use `captureThat` for conditional capturing.
---
reset(mock); // clear all stubs AND interactions clearInteractions(mock); // clear only recorded interactions
---
To mock a function type (e.g., a callback), define an abstract class with the required signature and generate mocks for it:
abstract class Callback {
void call(String value);
}
@GenerateMocks([Callback])---
logInvocations([mock1, mock2]); // print all collected invocations
---
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.