flutter-tests

A set of instructions for testing Flutter applications, including business logic, user interfaces, visual output, and full app flows. Flutter is Google's toolkit for building apps from one codebase.

In plain words
What is it for?
Use it to write tests for BLoCs, Cubits, use cases, repositories, widgets, golden images, integration flows, and test coverage.
Why use it?
It gives consistent testing patterns for common Flutter components and helps avoid unreliable tests, incorrect mocks, and missed state changes.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/yendangn/flutter-app-builder/flutter-tests
Any agent
npx skills add yendangn/flutter-app-builder --skill flutter-tests
Clone the repo
git clone --depth 1 https://github.com/yendangn/flutter-app-builder

Made for: Claude Code, Codex.

Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 469 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.00469
Opus 5 $0.00035 $0.00234
Sonnet 5 $0.00014 $0.00094
Haiku 4.5 $0.00007 $0.00047

Measured 2d ago against content hash b664fb0745b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flutter-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/flutter-tests/SKILL.md · 40 lines

What it actually says

Flutter Tests

Full reference: template.md

Key rules

Cubit / BLoC tests

  • Use bloc_test (blocTest<C, S>(...)) for all cubit tests. Never test cubits with pump() in widget tests.
  • Mock dependencies with mocktail. Register fallback values in setUpAll for any custom type used with any().
  • Use InMemoryStorage for HydratedCubit tests — never real disk.
  • Test state sequence exactly: expect: () => [isA<Loading>(), isA<Loaded>()].

Use case / Repository tests

  • Use cases are thin wrappers — verify delegation (correct method called, correct params, result passed through).
  • Repository tests: mock data sources, test online/offline paths, error wrapping (FailureException rethrown, generic → UnknownFailure).

Widget tests

  • pumpApp(widget) helper sets up MaterialApp, theme, localization, and test DI.
  • Test user interactions with tester.tap(find.byKey(...)) + tester.pump().
  • BlocProvider wraps the widget with a pre-configured mock cubit.

Golden tests

  • One golden per component state. Run flutter test --update-goldens for intentional visual changes.
  • GoldenToolkit / MatchesGoldenFile for multi-device golden comparison.

Coverage gate

  • scripts/check_coverage.sh <threshold> enforces coverage on presentation+core layers.
  • Exclude: generated files (*.g.dart), data sources, DI modules, platform wrappers.
  • Target: ≥ 80% on cubit + state + core layers.

Co-load with

  • flutter-ci — coverage gate runs in CI
  • flutter-base-classesBaseCubit, safeEmit behavior to test
Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 40 lines · 70 tokens per session scan A b664fb0745b7

Subscribe to this mod's changes

flutter-tests is a skill published in the GitHub repository yendangn/flutter-app-builder (5 stars, last pushed 2mo ago), licensed MIT. It adds 70 tokens to every session and 469 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.