dart-testing

Generate Dart and Flutter tests for unit logic, widgets, streams, and BLoC state.

7|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/chenziyang110/spec-kit-plus --skill dart-testing-chenziyang110
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-testing
Source: https://github.com/chenziyang110/spec-kit-plus/tree/main/templates/passive-skills/dart-testing
Command: npx skills add https://github.com/chenziyang110/spec-kit-plus --skill dart-testing-chenziyang110

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you generate correct and maintainable Dart/Flutter tests, especially when you need widget coverage, mocks, or coverage improvements.

Core Features & Use Cases

  • Purpose-built Dart/Flutter test guidance: Selects unit, widget, integration, and async/stream testing approaches based on what you’re testing.
  • Mocking-ready workflows: Uses mockito/mocktail patterns and flags dependency gaps before code generation.
  • Failure and flakiness diagnosis support: Guides targeted fixes for broken or flaky tests and helps you verify with proper running/coverage commands.

Quick Start

Ask your agent: “Write the appropriate Dart/Flutter tests for my failing widget and update the mocks so flutter_test and mockito work.”

Frequently Asked Questions about dart-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Flutter widget tests with mockito when dependencies are missing?

Writing Flutter widget tests with mockito requires identifying dependency gaps before code generation. The workflow uses mockito and mocktail patterns to generate runnable test code, enforcing stop conditions when testability or dependencies are missing to ensure flutter_test works properly.

What is the best way to diagnose flaky Dart and Flutter test failures?

Diagnosing flaky Dart and Flutter test failures involves guiding targeted fixes for broken behavior and verifying with proper running and coverage commands. This approach helps isolate async stream issues and BLoC state inconsistencies to improve overall test reliability.

How do I improve test coverage for Dart and Flutter codebases?

Improving Dart and Flutter test coverage requires selecting the right test tier, such as unit, widget, or integration testing. This process generates runnable test code and verification commands to target untested logic, streams, and BLoC state.

How do I test Dart streams and BLoC state using the appropriate testing framework?

Testing Dart streams and BLoC state uses the appropriate testing framework to handle async logic. This involves selecting the correct test tier and mocking strategy to verify stream emissions and state transitions with runnable test code.

Does this approach support both mockito and mocktail patterns for Dart testing?

Yes, this approach supports both mockito and mocktail patterns for Dart testing. It uses mocking-ready workflows to flag dependency gaps before code generation, ensuring the chosen mocking strategy aligns with your testing framework requirements.

When should I not use widget tests for my Flutter codebase?

You should not use widget tests when testability or dependencies are missing. The workflow enforces stop conditions in these cases, directing you to address dependency gaps or select a different test tier like unit or integration testing instead.