Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Flutter testing

Writes Flutter unit, widget, golden and integration tests, so layout and logic bugs get caught before release.

What we improved

Made the skill stand on its own. The original sent the reader to four other skills (tdd-workflow, flutter-state-management, mobile-visual-self-review, tdd-first) for the test-first rule, the state management shape, the size matrix and a wor

Improved by YourAISkill from the original by makifbaysal, under its Apache-2.0 licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.

Claude's review

8/10 Runnable Flutter unit, widget, matrix, accessibility, golden and integration examples with sharp pump and timer rules and real traps.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Use when testing Flutter code - unit tests for logic, widget tests for UI behavior, golden tests for appearance, the multi-size/text-scale/dark matrix, accessibility guidelines, test-first

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: flutter-testing
category: testing
description: "Writes and reviews Flutter tests at the right layer: plain unit tests for controllers and logic with fakes or mocktail, widget tests that assert visible behaviour across loading, data, empty and error states, a size, text scale and dark mode matrix that catches overflow, accessibility guideline checks, golden tests with real fonts and one OS, and integration tests for whole flows. Includes runnable examples, pump versus pumpAndSettle rules and the common traps (endless spinners, pending timers, HTTP returning 400, blind --update-goldens). Use when adding or fixing tests in a Flutter app, test-driving a new screen or layout change, or reviewing Flutter test code."
tech_stack: Flutter
source: flutter/agent-plugins (BSD-3-Clause), adapted
---
<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by makifbaysal. See CHANGES.md. -->

# Flutter Testing

## Overview

Test first: write the failing test, then the code. For logic that is a unit test; for a layout change it is the matrix cell that overflows. Three layers, each for a different question: does the logic work, does the widget behave, does it look right.

**Core principle:** most tests are fast unit and widget tests. Golden tests guard appearance; integration tests guard whole flows and are used sparingly.

| Layer | Question | Tool | Lives in |
|-------|----------|------|----------|
| Unit | Does the controller or logic compute correctly? | `test` from `flutter_test`, a fake repository | `test/` |
| Widget | Does the widget render each state and respond to taps? | `testWidgets`, `pumpWidget`, finders | `test/` |
| Golden | Does it match the approved pixels? | `matchesGoldenFile` | `test/`, tagged `golden` |
| Integration | Does the whole flow work on a device? | `integration_test` package | `integration_test/` |

Run with `flutter test`, one file with `flutter test test/tasks/task_controller_test.dart`, one case with `--plain-name 'retries'`.

## The code under test

The examples below test this small controller and screen (Dart 3, Flutter 3.10 or later). The point is the shape: logic in a `ChangeNotifier` behind a repository interface, the widget only rendering state and forwarding taps.

```dart
import 'package:flutter/material.dart';

sealed class TaskState {}
class TaskLoading extends TaskState {}
class TaskLoaded extends TaskState { TaskLoaded(this.tasks); final List<String> tasks; }
class TaskError extends TaskState { TaskError(this.message); final String message; }

abstract interface class TaskRepository { Future<List<String>> fetchTasks(); }

...

From makifbaysal's repository, Apache-2.0 licence.

Related skills

  • Checked

    React Native screens

    Writes React Native and Expo screens, navigation, lists and gestures that run without jank.

    by ericrisco 691
    7/101 credit
  • Checked

    Native Mobile App Design

    Designs Expo and React Native screens that feel truly native, with proper navigation, motion and dark mode.

    by Appllama 5.7k
    7/101 credit
  • Checked

    Expo App Shipping

    Builds, submits and updates your Expo app with EAS, and fixes over the air updates that never arrive.

    by ericrisco 691
    7/101 credit
  • Checked

    Gemini images in Flutter

    Generates and edits images in Flutter with Firebase AI Logic and Gemini, fixing quota and empty reply errors.

    by evanca 677
    7/101 credit
  • Checked

    React Native animation

    Builds Expo animations with Reanimated and gestures, choosing springs and timing so motion feels right.

    by expo 4.3k
    8/101 credit
  • Checked

    Dynatrace for React Native

    Adds Dynatrace monitoring and session replay to a React Native or Expo app, with Babel set up in the right order.

    by Dynatrace 190
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added