flutter-testing
Audited by Runlayer on Feb 21, 2026
Malicious tool definition detected
Tool: SKILL.md [1/2] Description: --- name: flutter-testing description: Comprehensive Flutter testing guidance covering unit tests, widget tests, and integration tests.
Tool: SKILL.md [2/2] Description: on testing Flutter plugins (including native code), see [Plugin Testing Reference](references/plugin-testing.md).
Malicious tool definition detected
Tool: references/common-errors.md [1/2] Description: # Common Testing Errors ## Overview This guide covers frequently encountered Flutter testing errors and their solutions. ## Layout Errors ### 'A RenderFlex overflowed...' **Error Message:** ``` The following assertion was thrown during layout: A RenderFlex overflowed by 1146 pixels on the right.
Tool: references/common-errors.md [2/2] Description: of pumpAndSettle() if animation loops }); ``` ## Data Errors ### 'RangeError' **Error Message:** ``` RangeError: Index out of range: index should be less than 5, but is 5 ``` **Cause:** Accessing list/array with invalid index.
Malicious tool definition detected
Tool: references/integration-testing.md [1/2] Description: # Integration Testing Guide ## Overview Integration tests test complete apps or large parts of apps on real devices or emulators.
Tool: references/integration-testing.md [2/2] Description: { await tester.pumpWidget(const MyApp()); final timeline = await tester.trace(() async { await tester.tap(find.byKey(const Key('animate'))); await tester.pumpAndSettle(); }); // Check for janky frames final jankyFrames = timeline.frames.where((frame) => frame.duration.inMicroseconds > 16667 // 60fps threshold ); expect(jankyFrames.length, lessThan(timeline.frames.length ~/ 10)); }); ``` ## Best Practices 1.
Malicious tool definition detected
Tool: references/mocking.md [1/2] Description: # Mocking Guide ## Overview Mocking replaces real dependencies with test doubles to isolate code and make tests deterministic.
Tool: references/mocking.md [2/2] Description: Avoid `any` when possible 5.
Malicious tool definition detected
Tool: references/plugin-testing.md [1/2] Description: # Plugin Testing Guide ## Overview Flutter plugins require special testing strategies because they include native code.
Tool: references/plugin-testing.md [2/2] Description: - Native failures, network issues 4.
Malicious tool definition detected
Tool: references/unit-testing.md Description: # Unit Testing Guide ## Overview Unit tests test individual functions, methods, or classes in isolation.
Malicious tool definition detected
Tool: references/widget-testing.md [1/2] Description: # Widget Testing Guide ## Overview Widget tests (component tests) verify that widgets render correctly and interact as expected.
Tool: references/widget-testing.md [2/2] Description: testWidgets('CounterWidget increments correctly', (tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( body: CounterWidget(), ), ), ); // Initial count expect(find.text('Count: 0'), findsOneWidget); // Increment await tester.tap(find.byKey(const Key('increment'))); await tester.pump(); expect(find.text('Count: 1'), findsOneWidget); }); ``` ## Testing with Mock Data ```dart class ProductList extends StatelessWidget { final Li