Dart Use Pattern Matching

by flutter0ef3972f93e2No license3K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 days ago

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.

Instructions only

Only the file list is public. File contents are available once the skill is installed in a workspace.

PathSizeType
examples/json_patterns.dart2.6 KBtext/plain
SKILL.md11.7 KBtext/markdown

Source and attribution

Source:flutter/agent-pluginsinskills/dart-use-pattern-matchingat commit0ef3972

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal