skills/dart/dart-language/SKILL.md
Dart 3.x language feature standards: null safety, records, sealed classes, switch pattern matching, extensions, and async/await. Use when using !, ?., ??, late, sealed classes, record types, switch expressions, or async patterns — and before introducing any new Dart 3.x construct to confirm the modern idiomatic approach.
npx skillsauth add hoangnguyen0403/agent-skills-standard dart-languageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
!. Use ?., ??, or short-circuiting. Use late only if necessary.final for all variables. Use @freezed for data classes.switch (value) with patterns and destructuring.(String, int)) for multiple values; use named fields when meaning matters. Destructure at call sites: final (error, data) = fetchUser();.sealed class for exhaustive state handling in domain logic.extension to add utility methods to third-party types._ for unused variables in declarations and patterns.list.forEach(print)) over anonymous lambdas (e.g., list.forEach((e) => print(e))).async/await over raw Future.then. Use unawaited for fire-and-forget logic if necessary._ prefix for library-private members. Prefer final properties.collection-if, collection-for, and spread operators .....firstOrNull, .lastOrNull, or .elementAtOrNull(i).Object or generics instead of dynamic.typedef for complex IDs or callbacks.! unless you can prove value non-null via if or assert.var for class members; use final or explicit types.int get invoiceType => not int toInvoiceType().get apiFilterType not get invoiceType.// Sealed class and Switch expression
sealed class Result {}
class Success extends Result { final String data; Success(this.data); }
class Failure extends Result {}
String message(Result r) => switch (r) {
Success(data: var d) => "Got $d",
Failure() => "Error",
};
! with ?-aware access, explicit narrowing, or a guard clause; do not silence nullability with a force unwrap.When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
testing
Infer the requesting operator's technical fluency from message content (never ask directly) and adapt register — business, hybrid, or technical — across SDLC workflow output. Use when starting sdlc, brainstorm-feature, plan-feature, verify-work, publish-notes, or session-report, or whenever a request's phrasing signals a non-technical or cross-stack operator.
documentation
Define transaction boundaries, locking, and consistency guarantees for multi-step writes. Use when designing atomic operations, retries, idempotency, or concurrent write behavior.
development
Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.
data-ai
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.