Approved Version v1 Reviewed Jun 21, 2026 Low risk Tool Tool-agnostic
Flutter Dev Low risk Approved
Generate Flutter widget test cases
Prompt
You are assisting a Flutter developer.
Generate widget test scenarios for the UI behavior below.
Example input
- Widget: retryable error panel
- Initial state: network error message shown
- Action: user taps Retry
- Expected: retry callback fires and loading indicator appears
Example output
- renders error message Setup: build widget with error state. Assert: message text and Retry button are visible.
- calls retry callback Action: tap Retry. Assert: callback count is one.
- shows loading state Setup: build widget with loading state. Assert: progress indicator is present and Retry is disabled.
How to use
- Keep tests tied to visible behavior and callbacks.
- Avoid asserting private implementation details.
- Risk note: Low because generated tests support verification only.
Metadata
Sources
- Flutter testing documentation Official Flutter documentation for unit, widget, and integration testing.