flutter-testing
Skill7 starsChanged 8 months agoMITView on GitHub
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.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Ethiel97/flutter-clean-riverpod-skillstheir own version, first seen Oct 2, 2026
- gabuldev/flutter-skillstheir own version, first seen Sep 17, 2026
- gspencergoog/skillstheir own version, first seen Sep 8, 2026
- lh17708357536-gif/flutter-cn-overseas-app-skillstheir own version, first seen Jul 13, 2026
- MADTeacher/mad-agents-skillstheir own version, first seen May 1, 2026
- dhruvanbhalara/skillstheir own version, first seen Mar 2, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- MADTeacher/mad-agents-skills★ 109same name
- dhruvanbhalara/skills★ 30same name
- lh17708357536-gif/flutter-cn-overseas-app-skills★ 21same name
- gabuldev/flutter-skills★ 11same name
- Ethiel97/flutter-clean-riverpod-skills★ 10same name
- gspencergoog/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- skill-creatorSkill
- flutter-dbSkill
- flutter-routingSkill
- flutter-state-managementSkill
- configuring-codemagicSkill
- applying-effective-dartSkill
- deploying-with-fastlaneSkill
- integrating-firebaseSkill
- implementing-fl-chartSkill
- integrating-google-adsSkill
- animating-flutter-widgetsSkill
- routing-with-autorouteSkill
- implementing-flutter-blocSkill
- configuring-deep-linksSkill
- persisting-data-with-driftSkill
- building-flutter-production-appsSkill
- generating-flutter-uiSkill
- routing-with-gorouterSkill
- managing-hive-storageSkill
- using-flutter-hooksSkill
- running-flutter-isolatesSkill
- managing-flutter-provider-stateSkill
- implementing-responsive-layoutsSkill
- implementing-riverpodSkill
- managing-secure-storageSkill
- flutter-setupSkill
- managing-shared-preferencesSkill
- implementing-flutter-social-authSkill
- using-fpdartSkill
- generating-freezed-modelsSkill
- configuring-github-actionsSkill
- building-jaspr-web-appsSkill
- testing-with-marionetteSkill
- implementing-openapi-in-dartSkill
- integrating-revenuecatSkill
- integrating-sentrySkill
- developing-serverpod-backendSkill
- building-shadcn-flutter-uiSkill
- integrating-supabaseSkill
- converting-ts-to-dartSkill
The file
Files
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
- 🧱 Testing Fundamentals
- 🛠️ Core Testing
- 🧪 Advanced Tools (Mocking, Goldens, Patrol E2E)
- 🔧 Troubleshooting & Edge Cases
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

