Skill / SKILL.md

Dart Use Pattern Matching

dart-lang/skills

Applies Dart 3 pattern matching, switch expressions, and destructuring idiomatically to validate data schemas, handle algebraic data types, and decompose control flow. Use when refactoring complex if-else chains, parsing polymorphic JSON or API responses, destructuring Lists, URI/path segments, String.split() tokens, Records, or Maps, or enforcing exhaustiveness on sealed classes. Don't use for simple boolean conditions, single-variable type promotion (use `is`), or basic collection filtering.
2 views 563 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Applies Dart 3 pattern matching, switch expressions, and destructuring idiomatically to validate data schemas, handle algebraic data types, and decompose control flow. Use when refactoring complex if-else chains, parsing polymorphic JSON or API responses, destructuring Lists, URI/path segments, String.split() tokens, Records, or Maps, or enforcing exhaustiveness on sealed classes. Don't use for simple boolean conditions, single-variable type promotion (use `is`), or basic collection filtering.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/dart-lang/skills' skill-source

Use the complete skill-source/skills/dart-use-pattern-matching directory with your client’s skill installer.

  • skills/dart-use-pattern-matching

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/dart-use-pattern-matching

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
dcc71740b41dfae10de231fe59126028c728b12791574407f54414bc49077490
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills