SKILL

flutter-testing

Flutter testing strategy (Flutter team, Very Good Ventures, LeanCode/Patrol; verified 2026) - fakes vs mocks, unit tests with mocktail, widget tests, golden tests with Alchemist, E2E/UI tests with Patrol including native permission dialogs and notifications, device farms and sharding, Widget Previews, Widgetbook, debugging tools. Use this whenever the user writes, fixes, or plans Flutter tests, sees flaky goldens or CI test failures, needs to test permissions/notifications/native UI, picks between integration_test, Appium and Patrol, or asks how to make Flutter code testable.

Target: Mobile development. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Flutter testing
  • Rules that apply to every level
  • Unit tests
  • Widget tests
  • Golden tests
  • UI / E2E tests with Patrol
  • Component catalogs & previews
  • Debugging

Verified 2026-09-25: Flutter 3.47, patrol 4.10, alchemist 0.14, mocktail 1.0, bloctest 10, flutterriverpod 3.4. For Riverpod/Bloc-specific test APIs, see flutter-state-management/references/. Use the testing pyramid on purpose. Most coverage in fast unit tests of logic, widget tests for components, a few goldens for visuals, and E2E UI tests only for critical user journeys. Each level checks something the others can't. Don't duplicate edge cases upward. | Level | Checks | Tool | |---|---|---| | Unit | Business logic, Cubits/Notifiers/ViewModels, repositories, mappers, validators | fluttertest + mocktail | | Widget | A component/screen's behavior in isolation | fluttertest (patrolfinders for nicer finders) | | Golden | How it looks: design-system components | Alchemist | | UI / E2E | The app's main purpose works end-to-end, including native UI | Patrol | Fakes over mocks (Flutter team, "strongly recommend"). Write FakeUserRepository implements UserRepository with in-memory behavior in testing/fakes/. Mocks (mocktail) are for checking interactions or one-off stubs. Keep them private per test file (class MockApi extends Mock implements Api {}), so a stub in one file can't leak into an

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
abugeek/flutter-skills
Source file
.claude/skills/flutter-testing/SKILL.md
Fixed revision
458377635834ad1cff2c4871ac0725a5ef4bcd4f
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: abugeek/flutter-skills · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T09:01:53.930Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.