dart-migrate-to-checks-package

Migrate Dart test assertions from package:matcher to package:checks.

2.8k|166|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/flutter/agent-plugins --skill dart-migrate-to-checks-package-flutter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-migrate-to-checks-package
Source: https://github.com/flutter/agent-plugins/tree/main/skills/dart-migrate-to-checks-package
Command: npx skills add https://github.com/flutter/agent-plugins --skill dart-migrate-to-checks-package-flutter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the technical debt and verbosity associated with legacy package:matcher assertions, providing a systematic path to adopt the modern, type-safe, and highly readable package:checks library.

Core Features & Use Cases

  • Automated Migration Guidance: Provides a structured workflow for replacing legacy expect calls with type-safe check syntax.
  • Syntax Mapping: Offers a comprehensive reference table to translate complex matchers like TypeMatcher.having, deep equality, and asynchronous expectations.
  • Use Case: Use this skill when modernizing a legacy Flutter or Dart test suite to improve developer productivity through better IDE autocomplete and more descriptive failure diagnostics.

Quick Start

Use the dart-migrate-to-checks-package skill to identify all legacy test assertions in the current project and provide a step-by-step plan for migrating them to the checks library.

Frequently Asked Questions about dart-migrate-to-checks-package

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

FAQPage Schema
How do I migrate Dart test assertions from package:matcher to package:checks?

To migrate Dart test assertions from package:matcher to package:checks, you replace legacy expect calls with type-safe check syntax. This systematic refactoring targets test suites to improve type safety, IDE autocomplete, and failure diagnostics.

What is the best way to refactor complex matchers like TypeMatcher.having in Flutter tests?

Refactoring complex matchers like TypeMatcher.having in Flutter tests requires mapping legacy syntax to the modern checks library. A comprehensive syntax mapping reference handles deep equality, asynchronous expectations, and custom matcher replacements.

Why should I modernize my Dart test suite to use the checks library?

You should modernize your Dart test suite to use the checks library to resolve technical debt and verbosity associated with package:matcher. It provides type-safe assertions, better IDE autocomplete, and highly readable, detailed failure diagnostics.

Does the checks library support handling collection equality and asynchronous expectations?

Yes, the checks library supports handling collection equality and asynchronous expectations. The migration process specifically targets these complex scenarios, providing a structured workflow to translate them into type-safe check syntax.

Can I use this migration workflow for legacy Flutter test suites requiring custom matcher replacement?

Yes, you can use this migration workflow for legacy Flutter test suites. It provides systematic refactoring guidance for replacing custom matchers, ensuring your test suite adopts the modern, type-safe checks library effectively.