accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes;…
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
$ npx -y skills add evanca/flutter-ai-rules --skill mocktail --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mocktailContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when creating mocks, stubbing methods, verifying interactions, registering fallback values, or choosing between mocks, fakes, and real objects (Mocktail).
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, reduced motion, or target sizes;…
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns…
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or…
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 values, or modernizing…
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.