Flutter testing
Skill Poorgramer-Zack/dart-expert-skills/skills/flutter-testing
A comprehensive library of modular Agent Skills for Flutter & Dart development
npx -y skills add Poorgramer-Zack/dart-expert-skills --skill flutter-testingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Covers Flutter testing across all three layers: unit tests (business logic, ViewModels, repositories), widget tests (UI rendering, interactions, golden regression), and integration/E2E tests (full app flows, native OS interactions). Use this skill when writing any Flutter test, setting up mocking with mocktail or mockito, implementing golden file tests, debugging async failures (pumpAndSettle timeouts, Timer leaks, FakeAsync deadlocks), fixing cross-platform golden pixel diffs in CI/CD, testing state management (Riverpod/BLoC/Provider), handling permission dialogs or native system UI with Patrol, or troubleshooting MediaQuery/Theme missing errors in widget tests.
SKILL.md
2.6 KB, 434 tokens by cl100k_base, as published. Nobody here has run it
Flutter Testing Guide
Overview
Flutter testing follows a three-layer pyramid: Unit (fast, pure Dart logic) β Widget (UI component rendering) β Integration/E2E (full device flows). Each layer has distinct tooling and tradeoffs. Load the relevant reference based on what you need to test.
Process
Phase 1: Choose the Right Layer
Identify the testing tier before writing any code. Wrong tier = wasted effort.
- π§± Testing Fundamentals β Decision tree for choosing unit/widget/integration, MVVM isolation patterns, and project structure.
Phase 2: Write Tests with Correct APIs
Apply AAA (Arrange-Act-Assert), proper pump usage, and matcher selection.
- π οΈ Core Testing β Unit test groups/setUp/tearDown, widget test pump patterns, integration test binding setup, and async troubleshooting (FakeAsync, runAsync, Timer leaks).
Phase 3: Mocking, Goldens, and E2E
Isolate external dependencies, lock UI visuals, and validate native OS interactions.
- π§ͺ Advanced Tools β Mocktail/Mockito, golden tests with cross-platform tolerance, Patrol 4.0 E2E (native permission dialogs, notifications), patrol_finders for widget tests.
Phase 4: Diagnose Failures
Resolve production testing failures in CI/CD pipelines.
- π§ Troubleshooting β Async errors, golden pixel diffs, MediaQuery crashes, Timer memory leaks, flaky mock configurations.
π Reference Library
What ships with it: 4 files
47.8 KB alongside SKILL.md
references/
- advanced-tools.md17.3 KB
- core-testing.md8.8 KB
- testing-fundamentals.md6.7 KB
- troubleshooting.md15.0 KB