dart-3-updates
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing pre-Dart-3 code.
npx skills add evanca/flutter-ai-rules --skill dart-3-updates --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Dart 3 Updates Skill Apply Dart 3 language features — branches, patterns, pattern types, and records — correctly and idiomatically. ## When to Use Use this skill when: * Writing or refactoring `switch` statements or `if-else` chains. * Creating new data-holding classes and deciding between sealed classes, records, or plain classes. * Destructuring values from maps, lists, records, or objects. * Modernizing pre-Dart-3 code to use patterns, exhaustiveness checks, or switch expressions. --- ## 1. Branches ### if / if-case ```dart // Standard if if (score >= 90) { grade = 'A'; } else if (score >= 80) { grade = 'B'; } else { grade = 'C'; } // if-case: match and destructure against a single pattern if (pair case [int x, int y]) { print('$x, $y'); } ``` - `if` conditions must evaluate to a `bool`. - In `if-case`, variables declared in the pattern are scoped to the matching branch. - If the pattern does not match, control flows to the `else` branch (if present). ### switch statements ```dart switch (command) { case 'quit': quit(); case 'start' || 'begin': // logical-or pattern startGame(); default: print('Unknown command'); } ``` - Each matched `case` body executes and jumps to the end —
- When to Use
- 1. Branches
- if / if-case
- switch statements
- switch expressions
- Exhaustiveness
- Guard clauses
- 2. Patterns
- Uses
- Object patterns
- JSON / nested data validation
- 3. Pattern Types
- 4. Records
- Multiple return values
What does the dart-3-updates skill do?
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing pre-Dart-3 code.
How do I install it?
Run `npx skills add evanca/flutter-ai-rules --skill dart-3-updates --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From evanca/flutter-ai-rules, a repository with 604 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
