
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.
Only the file list is public. File contents are available once the skill is installed in a workspace.
| Path | Size | Type |
|---|---|---|
| examples/json_patterns.dart | 2.6 KB | text/plain |
| SKILL.md | 11.7 KB | text/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.
More from flutter/agent-plugins

Flutter Use Http Package
flutter
Guides Flutter developers through using the http package for REST API requests, JSON parsing, and UI integration.

Flutter Setup Localization
flutter
Sets up Flutter app localization by adding packages, enabling code generation, and configuring ARB files.

Flutter Setup Declarative Routing
flutter
Guides Flutter developers through declarative routing and deep linking setup with go_router.

Flutter Fix Layout Issues
flutter
Diagnoses and fixes Flutter layout errors such as overflow and unbounded constraints using widget wrapping patterns.

Flutter Build Responsive Layout
flutter
Guides Flutter developers in building responsive layouts that adapt to different screen and window sizes.

Flutter Apply Architecture Best Practices
flutter
Guides Flutter app architecture using layered UI, Logic and Data separation with MVVM and repositories.