SKILL18.8K installs530

Dart Use Pattern Matching

Use switch expressions and pattern matching where appropriate

Type
Skill
Author
dart-lang
Category
Code Review
GitHub stars
530
Installs
18.8K
Last updated
October 16, 2026

Install

npx skills add https://github.com/dart-lang/skills --skill dart-use-pattern-matching

Use cases


Frequently Asked Questions

When should I reach for this skill?

During cleanup passes, when conditionals in Dart code have grown dense or repetitive.

Is it a general Dart style guide?

No — it is a targeted refactoring skill that changes control flow to use switch expressions and pattern matching.

Does it rewrite all conditionals?

It applies pattern matching where it fits better than the existing control flow, not everywhere.


About this skill

Refactors Dart code to use switch expressions and pattern matching where they fit better than the existing control flow. Use it during cleanup passes when conditionals have grown dense or repetitive. It's a targeted refactoring skill rather than a general style guide.

Summary written with AI assistance from the project's public description.


Categories


More from dart-lang


Similar Skills