flutter-testing
Skill3 starsChanged 10 days agoMITView on GitHub
Write unit, widget, and integration tests with robot patterns, widget keys, and Patrol in Flutter. Use when implementing test behavior; defer CI-only configuration without test changes.
10 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- dhruvanbhalara/skillstheir own version, first seen Nov 29, 2026
- Poorgramer-Zack/dart-expert-skillstheir own version, first seen Nov 15, 2026
- rolandtolnay/flutter-llm-toolkittheir own version, first seen Nov 8, 2026
- growerp/growerpedited, first seen Nov 1, 2026
- thienqo/flutter-skillstheir own version, first seen Nov 1, 2026
- gspencergoog/skillstheir own version, first seen Oct 16, 2026
Used with
Projects with it also use dart-concurrency, flutter-accessibility and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
thiennc-tesoglobalSkilldart-concurrency
Design and debug Dart asynchronous infrastructure with Future, Stream, isolates, cancellation, and lifecycle-safe ownership. Use for races, stale results, background CPU work, stream leaks, or async error handling; not for routine form-local validation or submission unless its underlying ordering mechanism is the task.
Also in 3 projects that use this
thiennc-tesoglobalSkillflutter-accessibility
Build or audit Flutter accessibility for semantics, screen readers, focus, keyboard access, text scaling, contrast, target size, and motion preferences. Pair with flutter-responsive-layout when large text causes reflow, clipping, or overflow across constraints.
Also in 3 projects that use this
MADTeacherSkillflutter-navigation
Implement, fix, refactor, review, migrate, or validate Flutter navigation and routing. Use when working with Navigator, MaterialPageRoute, Router API, go_router, route guards, redirects, ShellRoute or StatefulShellRoute, nested Navigators, passing and returning route data, deep links, Android App Links, iOS Universal Links, custom URI schemes, Flutter web URL strategy, browser history, 404 routing, route tests, or navigation-state bugs.
Also in 3 projects that use this
MADTeacherSkillflutter-networking
Implement, fix, debug, review, or refactor Flutter networking code for HTTP/REST APIs, WebSocket realtime flows, authentication and token refresh, request headers, timeouts, retries, JSON parsing, caching, background isolates, repositories, services, and adaptation to existing http, Dio, Retrofit, Chopper, or custom API clients. Use when asked to add network requests, investigate network errors, harden API clients, handle auth, or validate Flutter network behavior.
Also in 3 projects that use this
jerelvelardeSkillflutter-state-management
Flutter state management patterns — decision tree for setState, Provider, Riverpod, and BLoC with concrete examples and testing strategies
Also in 3 projects that use this
- +1 more from MADTeacher
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- growerp/growerp★ 11522% same
Wrote their own version · 9
- MADTeacher/mad-agents-skills★ 106same name
- dhruvanbhalara/skills★ 30same name
- thiennc-tesoglobal/flutter-skills★ 21same name
- thienqo/flutter-skills★ 21same name
- gabuldev/flutter-skills★ 12same name
- Ethiel97/flutter-clean-riverpod-skills★ 10same name
- Poorgramer-Zack/dart-expert-skills★ 7same name
- gspencergoog/skills★ 4same name
- rolandtolnay/flutter-llm-toolkit★ 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- verify-skillsmithSkill
- flutter-ci-debuggingSkill
- gcp-cloud-run-opsSkill
- project-factorySkill
- skill-auditSkill
- skill-pack-installerSkill
- skill-syncSkill
- skill-update-checkSkill
- skill-vetterSkill
- flutter-error-handlingSkill
- flutter-performanceSkill
- flutter-securitySkill
- better-motionSkill
- better-uiSkill
- emil-design-engSkill
- ui-ux-pro-maxSkill
- feature-forgeSkill
- platform-pipelineSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
[MOB-TEST-03]Entity Invariant & Serialization: Test calculations, validations, domain invariants, and non-trivial fromJson/toJson or … - Very specific: line 49
Negative Assertions: Add expectXxxNotVisible() in the robot only when absence is part of the business contract.
- Very specific: line 52
Integration Testing: Use patrolTest with IntegrationAuthHelper.loginOrSkip($) for auth and native interactions ($.native.*) for …
- Very specific: line 61
No local mocks: Use test/shared/. No missing bloc stub: stub state + stream.
- Very specific: line 62
No unchecked text casing: Verify .toUpperCase() / .tr() against source.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Testing Standards
Priority: P0 (CRITICAL)
Universal anti-slop rules (naming, identity fixtures, tautologies, skip/focus, mock echoing, bug-first lock, sleeps, shallow assertions, coverage): anti-slop-rules.md. Only Flutter deltas follow.
Core Rule Anchors
[MOB-TEST-02]BLoC State Invariant: Assert transitions withisA<State>().having(...); never mirror fullcopyWithtrees. Ban vacuousexpect: () => [isA<BaseState>()]without.having(...)orverify(GUARD-DART-VACUOUS-STATE), seed echoes (GUARD-DART-SEED-ECHO), duplicatebuild/seed/act/expectscenarios (GUARD-DART-BLOC-DUPLICATE), and collaborator mock echoes (GUARD-DART-MOCK-ECHO).[MOB-TEST-03]Entity Invariant & Serialization: Test calculations, validations, domain invariants, and non-trivialfromJson/toJsonor error mapping. Ban tests of generated code and trivial getters/props.[MOB-TEST-04]Contract Testing: Repositories and data sources prove contract compliance, golden JSON parsing, and error mapping; ban 1:1 pass-through echoing (when(() => dataSource.get()).thenAnswer((_) async => x); expect(await repo.get(), x)).[MOB-TEST-06]Layer & Device Fidelity: Unit > Widget > Patrol integration (patrolTest). Default 800×600 widget tests never prove device layout, native permissions, or deep links; desktop emulation never substitutes native E2E.
Conventions
- Test Pyramid: Unit > Widget > Integration;
_integration_test.dartonly inintegration_test/. - AAA: Arrange, Act, Assert in every test.
- Builders: Fluent builders when setup repetition obscures intent (
OrderBuilder); avoid shared global mocks. - Robot-First: Route all UI interactions and assertions through the Robot pattern (extending
BaseRobot), never rawfind.*/expect()in a test body. UseWidgetKeysconstants fromlib/core/keys/; no inlineKey. - Negative Assertions: Add
expectXxxNotVisible()in the robot only when absence is part of the business contract. - Widget Testing & Mocking:
TestWrapper.init()+tester.pumpLocalizedWidget(...). Register mock BLoCs withGetItinsetUpAll; stubstateandstreaminsetUp(usewhenListen,settle: falsefor loading states). Prohibitany(). - Integration Testing: Use
patrolTestwithIntegrationAuthHelper.loginOrSkip($)for auth andnative interactions($.native.*) for permissions, alerts, and lifecycle. For permission flows, assert the dialog (isPermissionDialogVisible) before granting or denying, and assert granted and denied outcomes as separate tests.
Anti-Patterns
- BLoC slop (
GUARD-DART-*): Ban vacuousisA<State>(), seed echoes, duplicate scenarios, and 30-propertycopyWithtrees. - Test-body logic: No
find.*/expect()in the test body or in integration tests without a robot. - Fixed sleeps (
GUARD-E2E-01): BanFuture.delayed(...); usepumpAndSettle()or a condition matcher. - No local mocks: Use
test/shared/. No missing bloc stub: stubstate+stream. - No unchecked text casing: Verify
.toUpperCase()/.tr()against source.
Verification
- Repositories use fakes over mocks where appropriate.
- Distinct BLoC behaviors (loading, success, error) asserted with
isA<State>().having(...). - Views with distinct UI logic covered via the robot at the proper layer.
- Critical user flows have at least one
patrolTestintegration test. flutter testpasses.- Mobile scenarios follow Mobile Testing Methodology.
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.

