---
name: flutter-widget-test-generator
description: "Generate boilerplate Widget Tests for your Flutter UI components. Use when the user wants help with Flutter Widget Test Generator. Related topics: flutter, testing, coding."
---

# Flutter Widget Test Generator

Generate boilerplate Widget Tests for your Flutter UI components.

## How to use this skill

1. Ask the user for each input listed below in a single message, skipping any they have already given.
2. Where options are listed, offer them, but accept other answers too.
3. Fill the answers into the prompt template, then follow the completed prompt to produce the result.

## Inputs

- **Paste Flutter widget here** (longer free text)
- **What does the widget do?** (free text, e.g. "")
- **Scenarios to test** (choose any: Renders correctly, Tap events trigger callbacks, Displays error states, Loading states)
- **Package used for testing** (choose one: flutter_test (Default), patrol, golden_toolkit)
- **Include a golden test template?** (choose one: Yes, No)

## Prompt template

## Introduction
Write reliable UI tests for your Flutter apps effortlessly.

## Widget Details
- Paste the Widget code (or interface):
{{Paste Flutter widget here}}
- What does the widget do?: {{What does the widget do?}}

## Test Requirements
- Scenarios to test: {{Scenarios to test}}
- Package used for testing: {{Package used for testing}}
- Include a golden test template? {{Include a golden test template?}}

---
**Goal**: Output the complete Dart test file containing the widget tests.

---

Source: [Flutter Widget Test Generator on PromptBuild](https://promptbuild.io/prompt/StPdV5qggPNknArzP8Kx/flutter-widget-test-generator)
