← ClaudeAtlas

dart-expertlisted

Production Dart (3.x): null safety, async/streams, sealed classes + exhaustive pattern matching, records, Result-style errors, isolates, testing. Use when writing/reviewing Dart domain logic, packages, CLIs, serialization, or concurrency (non-UI).
juliuswiener/nord-kit · ★ 0 · AI & Automation · score 65
Install: claude install-skill juliuswiener/nord-kit
# Dart Expert Modern Dart (3.x) for language/domain logic. For Flutter widgets/UI use **flutter-ui-ux**. ## Defaults - Sound null safety: avoid `!` (bang) and unchecked `as`. Prefer `?.`, `??`, and `late` only when init is guaranteed. A `!` that throws is a bug you chose. - Immutability: `final` by default, `const` constructors for value types, `copyWith` for updates. - Records for lightweight multi-return: `(int, String) f() => (1, "ok");` — name fields when not positional: `({int code, String msg})`. - Sealed classes + exhaustive `switch` for closed state, instead of enum-with-data or inheritance trees: ```dart sealed class Result<T> {} class Ok<T> extends Result<T> { final T value; Ok(this.value); } class Err<T> extends Result<T> { final Object error; Err(this.error); } // compiler errors if a case is missed: final msg = switch (r) { Ok(:final value) => '$value', Err(:final error) => 'fail: $error' }; ``` ## Errors - Model expected failures as data (`Result`/sealed); throw only for programmer errors / truly exceptional cases. - No bare `catch (e)` that swallows — catch specific types, rethrow with context, or convert to `Err`. - `Future` errors: `await` inside `try`; don't mix `.then` chains with `await`. Unawaited futures = silent failures → mark `unawaited(...)` deliberately. ## Async / concurrency - `async/await` over raw `Future.then`. `Future.wait([...])` for parallel, never a sequential `await` loop. - Streams: `await for` to consume; choose b