dart-use-pattern-matching
Modernize Dart Code with Pattern Matching
Complex Dart branching can obscure validation, destructuring, and subtype handling. This skill selects clear patterns and checks exhaustive switch behavior.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "dart-use-pattern-matching" from https://skillstore.io/skills/flutter-dart-use-pattern-matching.md and its manifest at https://skillstore.io/api/skills/flutter-dart-use-pattern-matching/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "dart-use-pattern-matching". Choose a pattern for a decoded user object containing a name and age list.
Expected outcome:
Use a map pattern containing a two-element list pattern. Bind the name as String and age as int, with a fallback for invalid input.
Using "dart-use-pattern-matching". Review area calculation for sealed Square and Circle types.
Expected outcome:
- Use an exhaustive switch expression because every case returns a value.
- Use object patterns to extract dimensions directly.
- Avoid a wildcard so newly added shape types produce an analyzer error.
Security Audit
SafeAll static findings are false positives caused by Markdown backticks, Dart code fences, print examples, and one standard local analyzer command. No malicious intent, prompt injection, unsafe command construction, or system reconnaissance was found.
Risk Factors
⚙️ External commands (36)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/flutter-dart-use-pattern-matching/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/flutter-dart-use-pattern-matching?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/flutter-dart-use-pattern-matching?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/flutter-dart-use-pattern-matching/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/flutter-dart-use-pattern-matching.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA · BibTeX · CFF)
APA citation
flutter. (2026). dart-use-pattern-matching security audit report (audit version 1) [Author version unspecified]. Skillstore. https://skillstore.io/skills/flutter-dart-use-pattern-matching/audits/1BibTeX citation
@techreport{flutter-flutter-dart-use-pattern-matching-2026,
author = {flutter},
title = {dart-use-pattern-matching security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/flutter-dart-use-pattern-matching/audits/1},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "dart-use-pattern-matching security audit report (audit version 1)"
version: "unspecified"
type: report
authors:
- name: "flutter"
date-released: "2026-08-19"
url: "https://skillstore.io/skills/flutter-dart-use-pattern-matching/audits/1"
identifiers:
- type: other
value: "skillstore:flutter-dart-use-pattern-matching:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Validate decoded data
Convert nested data checks into map and list patterns that validate structure while extracting typed values.
Refactor branching logic
Replace repetitive conditionals with concise switch expressions, logical patterns, and guard clauses.
Review exhaustive models
Check sealed class and enum handling for missing cases before code review.
Try These Prompts
Recommend the best Dart pattern for this data shape and explain the choice: [describe data and desired result].
Refactor this Dart conditional using pattern matching. Preserve behavior and explain whether a switch expression or statement fits: [paste code].
Design Dart map and list patterns for this decoded structure. Extract required values and handle malformed input: [describe structure].
Review these Dart sealed types and switch cases. Identify missing subtypes, unsafe wildcards, guard issues, and variable binding conflicts: [paste definitions].
Best Practices
- Run dart analyze after changing switches over sealed classes or enums.
- Use guards only when the condition cannot be represented clearly as a pattern.
- Prefer explicit subtype cases when future additions should trigger exhaustiveness errors.
Avoid
- Do not use null-assert or cast patterns when failed matches should remain recoverable.
- Do not add a wildcard merely to silence an exhaustiveness error.
- Do not use logical-or patterns with different variable bindings across branches.