wishtohear/bucket-water-oms/dart-modern-features
Claude Code and agent skill by wishtohear/bucket-water-oms
- community
Checking that the SKILL.md file is still in the repository.
Guidelines for using modern Dart features (v3.0 - v3.10) such as Records, Pattern Matching, Switch Expressions, Extension Types, Class Modifiers, Wildcards, Null-Aware Elements, and Dot Shorthands.
Install
npx vskill@latest install wishtohear/bucket-water-oms/dart-modern-featuresSKILL.md
Dart Modern Features
1. When to use this skill
Use this skill when:
- Writing or reviewing Dart code targeting Dart 3.0 or later.
- Refactoring legacy Dart code to use modern, concise, and safe features.
- Looking for idiomatic ways to handle multiple return values, deep data
extraction, or exhaustive checking.
2. Features
Records
Use records as anonymous, immutable, aggregate structures to bundle multiple objects without defining a custom class. Prefer them for returning multiple values from a function or grouping related data temporarily.
Avoid: Creating a dedicated class for simple multiple-value returns.
Prefer: Using records to bundle types seamlessly on the fly.
Patterns and Pattern Matching
Use patterns to destructure complex data into local variables and match against specific shapes or values. Use them in switch, if-case, or variable declarations to unpack data directly.
Avoid: Manually checking types, nulls, and keys for data extraction.
Prefer: Combining type-checking, validation, and assignment into a single statement.
Switch Expressions
Use switch expressions to return a value directly, eliminating bulky case and break statements.
Avoid: Using switch statements where every branch simply returns or assigns a value.
Prefer: Returning the evaluated expression directly using the => syntax.
Class Modifiers
Use class modifiers (sealed, final, base, interface) to restrict how classes can be used outside their defines library. Prefer sealed for defining closed families of subtypes to enable exhaustive checking.
Avoid: Using open abstract classes when the set of subclasses is known and fixed.
Prefer: Using sealed to guarantee to the compiler that all cases are covered.
Extension Types
Use extension types for a zero-cost wrapper around an existing type. Use them to restrict operations or add custom behavior without runtime overhead.
Avoid: Allocating new wrapper objects just for domain-specific logic or type safety.
Prefer: Using extension types which compile down to the underlying type at runtime.
Digit Separators
Use underscores (_) in number literals strictly to improve visual readability of large numeric values.
Avoid: Long number literals that are difficult to read at a glance.
Prefer: Using underscores to separate thousands or other groupings.
Wildcard Variables
Use wildcards (_) as non-binding variables or parameters to explicitly signal that a value is intentionally unused.
Avoid: Inventing clunky, distinct variable names to avoid "unused variable" warnings.
Prefer: Explicitly dropping the binding with an underscore.
Null-Aware Elements
Use null-aware elements (?) inside collection literals to conditionally include items only if they evaluate to a non-null value.
Avoid: Using collection if statements for simple null checks.
Prefer: Using the ? prefix inline.
Dot Shorthands
Use dot shorthands to omit the explicit type name when it can be confidently inferred from context, such as with enums or static fields.
Avoid: Fully qualifying type names when the type is obvious from the context.
Prefer: Reducing visual noise with inferred shorthand.
Related Skills
- [dart-best-practices]: General code
style and foundational Dart idioms that predate or complement the modern syntax features.
[dart-best-practices]: https://github.com/kevmoo/dash_skills/blob/main/.agent/skills/dart-best-practices/SKILL.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbucket-water-oms-admin-mobile/tool/dart_skills_lint/.agents/skills/dart-modern-features/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wishtohear/bucket-water-oms/dart-modern-features)