Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

Dart 3 Modernization Guide

A skill for writing idiomatic Dart 3 pattern matching, records and sealed classes, and for migrating pre-Dart-3 code.

Dev & CodingIntermediate★ 651⑂ 67AI score 8/10Last updated: Oct 10, 2026

What it does

  • Writes correct Dart 3 switch statements/expressions, if-case branches and when guard clauses.
  • Explains destructuring of lists, maps, records and objects via patterns.
  • Provides a full reference table of pattern types (logical or/and, relational, cast, null-check, rest elements, and more).
  • Gives decision criteria for choosing records versus data classes.
  • Modernizes legacy code with a 4-step workflow: if-else → switch expressions, abstract → sealed classes, wrapper classes → records, then verify with dart analyze.

Who it's for

  • Flutter/Dart developers upgrading a codebase to modern syntax.
  • Anyone converting state or Result/Success/Failure hierarchies into sealed classes for exhaustive switches.
  • Maintainers cleaning up long if-else chains or old break-heavy switches.

Examples

  1. "Turn this status if-else chain into a switch expression" → exhaustive enum-based switch expression.
  2. "Safely validate this API JSON response" → suggests map/list patterns like if (data case {'user': [String name, int age]}).
  3. "My function returns two values — do I need a class?" → applies the record-vs-class criteria and returns (String name, int age) with destructuring.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/evanca/flutter-ai-rules/HEAD/skills/dart-3-updates/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/dart-3-updates folder from the GitHub repo evanca/flutter-ai-rules into my ~/.claude/skills/dart-3-updates/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/evanca/flutter-ai-rules.git /tmp/flutter-ai-rules && mkdir -p ~/.claude/skills && cp -r /tmp/flutter-ai-rules/skills/dart-3-updates ~/.claude/skills/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Open a terminal.
  2. Clone the repository: git clone https://github.com/evanca/flutter-ai-rules.git
  3. Create the skills directory if needed: mkdir -p ~/.claude/skills
  4. Copy just this skill: cp -r flutter-ai-rules/skills/dart-3-updates ~/.claude/skills/
  5. Restart Claude Code, then ask something like "refactor this switch to Dart 3 style" and the skill activates automatically.
  6. Confirm your pubspec.yaml SDK constraint is >=3.0.0; otherwise the pattern syntax will not compile.