1. Habit
  2. Skills
  3. Flutter Add Widget Test skill
flutter · 39K installs

Flutter Add Widget Test skill
Runs by itself, PR changes a widget.

Every new widget gets a test.

Install the Flutter Add Widget Test skill and make it a habit: follow https://gethabit.dev/skills/flutter/flutter-add-widget-test.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

39K installs3K starsBSD-3-Clause licenceSource on GitHub ↗

Flutter Add Widget Test

by flutter · 39K installs

The skill

The flutter add widget test skill writes component tests with WidgetTester, finders and matchers to check rendering, taps, scrolling and text input.

Only when you ask.

The habit

Every new widget gets a test.

↻ Runs by itselfPR changes a widget

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one widget per run and at most two fix rounds.

  1. 01

    Check setup

    Make sure flutter_test is a dev dependency and tests live in test/.

  2. 02

    Define the test

    Write testWidgets and build the widget with tester.pumpWidget.

  3. 03

    Check first render

    Use finders and expect to verify the initial state.

  4. 04

    Interact

    Tap, drag, enterText or scrollUntilVisible as the widget needs.

  5. 05

    Rebuild and check

    Call pump or pumpAndSettle and verify the new state.

  6. 06

    Run until green

    Run flutter test on the file and fix failing matchers.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the Flutter Add Widget Test skill helps.

Use it when

  • ✓ You add or change a Flutter widget
  • ✓ You test taps or text input
  • ✓ You test a list or animation

Skip it when

  • – You need a full app flow test
  • – The app is not Flutter

Questions

Flutter Add Widget Test skill, answered.

When do I use pumpAndSettle?

For animations, transitions or async updates, so all frames finish.

Does my widget need a MaterialApp?

Wrap it in one, or in Directionality, if it needs theme or text direction.

How do I install the Flutter Add Widget Test skill?

Copy the prompt at the top into your agent. It installs the skill from flutter/agent-plugins and sets up the habit. Or run npx skills add flutter/agent-plugins --skill flutter-add-widget-test.

Is the Flutter Add Widget Test skill free?

Yes. It is published under BSD-3-Clause. Habit is free too.

Flutter Add Widget Test. Now as a habit.

Install the Flutter Add Widget Test skill and make it a habit: follow https://gethabit.dev/skills/flutter/flutter-add-widget-test.md

  • Free
  • No account
  • Undo in one line

All flutter skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by flutter, published under BSD-3-Clause. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.