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.
Установить с помощью моего Агента
Скопируйте этот запрос в своего Агента. Он содержит каноническую страницу Skill и манифест.
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.Ваш Агент по-прежнему должен показать план и запросить все подтверждения, требуемые политикой безопасности.
Ресурсы для AI-агентов
Используйте эти ссылки, когда AI-агенту, crawler или script нужен чистый контекст вместо полной страницы.
Протестировать
Использование «dart-use-pattern-matching». Choose a pattern for a decoded user object containing a name and age list.
Ожидаемый результат:
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.
Использование «dart-use-pattern-matching». Review area calculation for sealed Square and Circle types.
Ожидаемый результат:
- 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.
Аудит безопасности
БезопасноAll 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.
Факторы риска
⚙️ Внешние команды (36)
Поделиться и цитировать этот отчет
Делитесь версионным отчетом об оценке, нейтральным значком, встраиваемой карточкой и цитатами. Skillstore публикует доказательства, не решая, безопасен ли этот Skill.
Копировать ссылку на отчёт
https://skillstore.io/skills/flutter-dart-use-pattern-matching/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportЗначок Markdown
[](https://skillstore.io/skills/flutter-dart-use-pattern-matching?utm_source=security_passport_badge)Значок HTML
<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>Встраиваемая карточка
<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>Академические ссылки (APA · BibTeX · CFF)
Цитата APA
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/1Цитата BibTeX
@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
Почему такая оценка Достоверность доказательств: СреднийЧто вы можете построить
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.
Попробуйте эти промпты
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].
Лучшие практики
- 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.
Избегать
- 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.