# dart3-idioms-and-coding-standards

> Claude/Codex skill by [@zakariaf](https://omgskills.com/library/zakariaf/index.md) · 61 stars · Updated 2026-09-23

Enforces which Dart 3 construct each declaration earns — sealed class + exhaustive switch with no \`default:\`/\`case \_:\`, the three class modifiers (\`sealed\`/\`final\`/\`abstract interface class\`) and skip the rest, records as intra-layer tuples only, immutable value types (\`final\` fields, \`const\` ctor, value equality) hand-rolled when trivial and \`freezed\` when boilerplate dominates, explicit stable identity, total non-throwing domain functions, make-illegal-states-unrepresentable, and firm method/build/file/nesting complexity limits (the single-source-of-truth table other skills cite) — while banning \`late\`/\`!\`/\`dynamic\` honesty dodges. Use when authoring or reviewing any Dart type or declaration: class vs enum vs record vs typedef, hand-rolled vs \`freezed\`, adding a \`switch\`/\`if-case\`, writing \`copyWith\` or \`==\`/\`hashCode\`, deciding identity, keeping a domain function total, or hitting a length/nesting limit.

Tags: agent-skills, ai-agents, best-practices, claude-code, codex, coding-agent, cursor, dart, dartlang, developer-tools, drift, flutter, flutter-architecture, github-copilot, go-router, llm, material-design, mvvm, riverpod, skills

## Install

```sh
git clone https://github.com/zakariaf/Flutter-Skills /tmp/Flutter-Skills && ln -s /tmp/Flutter-Skills/skills/dart3-idioms-and-coding-standards ~/.claude/skills/dart3-idioms-and-coding-standards
```

## From README

Dart 3 idioms and coding standards Modern Dart 3.x, value-type-first, total functions for domain logic. A language feature earns its place when it converts a runtime silence into a compile error; everything else is decoration. This skill governs how each declaration is typed, named, kept immutable, and kept total — the error-handling architecture that rides on top of these mechanics lives in error-handling-typed-results. Read the reference for the task at hand: references/construct-verdict-table.md — the feature-by-feature verdict table (sealed / enum / record / class modifiers / extension type / codegen packages), with the rationale for each Use / Skip. references/immutability-and-equality.md — immutable value types, copyWith, when to hand-write ==/hashCode, and stable-identity vs value-equality. references/complexity-and-honesty.md — the length/nesting limits with their evidence, and the late/!/dynamic honesty-dodge bans in full. Run scripts/check-dart3-idioms.sh before a PR.

## Links

- HTML page: https://omgskills.com/library/zakariaf/flutter-skills/skills/dart3-idioms-and-coding-standards/
- GitHub: https://github.com/zakariaf/Flutter-Skills
- Author: [@zakariaf](https://omgskills.com/library/zakariaf/index.md)

## More from this repo

- [accessibility-as-code](https://omgskills.com/library/zakariaf/flutter-skills/skills/accessibility-as-code/index.md) — Enforces accessibility as a correctness property authored into each widget — Semantics(button/label) or...
   - [@zakariaf](https://omgskills.com/library/zakariaf/index.md) · 61 stars
- [adaptive-layout](https://omgskills.com/library/zakariaf/flutter-skills/skills/adaptive-layout/index.md) — Enforces adapting layout by available CONSTRAINTS/size, never device or platform checks — LayoutBuilder +...
   - [@zakariaf](https://omgskills.com/library/zakariaf/index.md) · 61 stars
- [ads-and-iap-monetization](https://omgskills.com/library/zakariaf/flutter-skills/skills/ads-and-iap-monetization/index.md) — Enforces opt-in, rewarded-first monetization over the service seam — a rewarded view grants exactly one benefit and...
   - [@zakariaf](https://omgskills.com/library/zakariaf/index.md) · 61 stars
