/custom-plugin-flutter:custom-plugin-flutter-skill-testingfrom custom-plugin-flutter
Provides testing patterns for Flutter apps: unit tests, widget tests, integration tests, E2E, mocking, and coverage with production-ready Dart examples.
Ships in custom-plugin-flutter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
// Unit test
void main() {
group('Calculator', () {
late Calculator calc;
setUp(() {
calc = Calculator();
});
test('add returns sum', () {
expect(calc.add(2, 3), equals(5));
});
});
}
// Widget test
void main() {
testWidgets('Counter increments', (tester) async {
await tester.pumpWidget(const MyApp());
expect(find.text('0'), findsOneWidget);
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
expect(find.text('1'), findsOneWidget);
});
}
// Integration test
void main() {
group('User Flow', () {
testWidgets('Complete user journey', (tester) async {
await tester.pumpWidget(const MyApp());
await tester.tap(find.text('Login'));
await tester.pumpAndSettle();
expect(find.text('Welcome'), findsOneWidget);
});
});
}
class UserService {
Future<User> getUser(String id) async {
// Implementation
}
}
void main() {
group('UserService', () {
late UserService service;
late MockUserRepository mockRepository;
setUp(() {
mockRepository = MockUserRepository();
service = UserService(mockRepository);
});
test('getUser returns user', () async {
final user = User(id: '1', name: 'John');
when(mockRepository.getUser('1')).thenAnswer((_) async => user);
final result = await service.getUser('1');
expect(result, user);
verify(mockRepository.getUser('1')).called(1);
});
test('getUser throws on error', () async {
when(mockRepository.getUser('1'))
.thenThrow(Exception('Not found'));
expect(
() => service.getUser('1'),
throwsException,
);
});
});
}
void main() {
testWidgets('Render user card', (tester) async {
const user = User(id: '1', name: 'John Doe', email: '[email protected]');
await tester.pumpWidget(
MaterialApp(home: Scaffold(body: UserCard(user: user))),
);
expect(find.text('John Doe'), findsOneWidget);
expect(find.text('[email protected]'), findsOneWidget);
});
testWidgets('Tap user card navigates', (tester) async {
const user = User(id: '1', name: 'John Doe', email: '[email protected]');
await tester.pumpWidget(MaterialApp(home: Scaffold(body: UserCard(user: user))));
await tester.tap(find.byType(UserCard));
await tester.pumpAndSettle();
expect(find.byType(UserDetailPage), findsOneWidget);
});
}
class MockUserRepository extends Mock implements UserRepository {}
final mockRepository = MockUserRepository();
// Setup mock behavior
when(mockRepository.getUser('1')).thenAnswer((_) async => User(...));
// Verify calls
verify(mockRepository.getUser('1')).called(1);
// Capture arguments
final captured = verify(mockRepository.updateUser(captureAny)).captured;
void main() {
group('User Creation Flow', () {
testWidgets('Create user and verify', (tester) async {
await tester.pumpWidget(const MyApp());
// Navigate to create user
await tester.tap(find.text('Add User'));
await tester.pumpAndSettle();
// Fill form
await tester.enterText(find.byKey(Key('nameField')), 'John');
await tester.enterText(find.byKey(Key('emailField')), '[email protected]');
// Submit
await tester.tap(find.text('Create'));
await tester.pumpAndSettle();
// Verify result
expect(find.text('User created'), findsOneWidget);
});
});
}
Ensure bulletproof quality with comprehensive testing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
flutter-testing, unit-testing, widget-testing, mockito, code-coverage
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, commands: Invalid input, agents: Invalid input, skills: Invalid input
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Other plugins' skills for the same job
12 skills in this plugin
/custom-plugin-flutter-skill-accessibilityProduction-grade Flutter accessibility mastery - Semantics API, screen readers (VoiceOver/TalkBack), WCAG 2.1 AA/AAA compliance, inclusive design patterns, automated a11y testing with comprehensive code examples/custom-plugin-flutter-skill-animationsProduction-grade Flutter animations mastery - Implicit and explicit animations, AnimationController, Hero transitions, physics-based motion, Lottie/Rive integration, 60fps optimization with comprehensive code examples/custom-plugin-flutter-skill-backend1500+ lines of backend integration mastery - REST APIs, GraphQL, WebSockets, authentication, Firebase, error handling with production-ready code examples.