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 returning multiple values.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",
};
development
Standardize SRS and FRS specifications for technical behavior, interfaces, data contracts, quality constraints, and verification mapping. Use when writing SRS, functional specification, system behavior requirements, API/data contracts, or non-functional thresholds.
development
Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable value outcomes. Use when creating BRD, business case, project justification, ROI narrative, or AS-IS to TO-BE scope.
development
Implements a strict Red-Green-Refactor loop to ensure zero production code is written without a prior failing test. Use when: creating new features, fixing bugs, or expanding test coverage.
testing
Standardize PRD discovery and drafting for product scope, user outcomes, requirement IDs, and acceptance criteria. Use when creating PRD, product requirements, feature specification, or acceptance criteria plan.