dart-use-pattern-matching
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…
Full publisher description
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.
Source details
Read SKILL.md ↗ · Browse skill folder ↗
google/skills_lint.dart
third_party/skill-repos/dart-lang-skills/.agents/skills/dart-use-pattern-matching/SKILL.mdPinned revision 54745ba3240a6f317647d90e1e8fa8a55918328d
Source checked
Reviewed licence: BSD-3-Clause
Specific instruction/source terms; preserve the linked licence conditions, notices and attribution.
Reviewed publisher revision ↗ · 2026-11-22
This indexed source has a different revision. Verify its applicable terms before use.
This skill page is available in English. Publisher instructions stay in their original language.