← ClaudeAtlas

flutter-dart-stylelisted

Write modern, concise, idiomatic Dart 3.13 / Flutter 3.47 code - primary constructors, private named parameters, dot shorthands, null-aware elements, patterns and sealed classes, records, extension types, widget-class conventions, const, lints (very_good_analysis/flutter_lints), Effective Dart naming. Use this whenever writing or refactoring any Dart/Flutter code, generating widgets, models or classes, reviewing code style, or when code looks verbose, outdated (pre-Dart-3) or full of `!` and if/else chains - apply it by default to all Flutter code you write.
abugeek/flutter-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill abugeek/flutter-skills
# Modern Dart & Flutter code style Verified 2026-09-25: **Flutter 3.47.5 / Dart 3.13.4** (stable). Language features depend on the package's SDK constraint. Check `environment: sdk:` in `pubspec.yaml` before using a feature. The minimum language version is noted on each item below. Goal: **less code, same behavior, and mistakes caught by the compiler instead of at runtime.** Don't write code the SDK, the language, or an existing dependency already provides. ## 1. Classes & models - **Primary constructors (3.13)** declare fields and constructor in the header: ```dart class Point(final int x, final int y); // immutable fields x, y class const Money(final int cents, final String currency); // const primary constructor class User({required final String _id, final String? nickname}); // 3.12 private named param: caller passes `id:` class Admin(super.name, final Set<String> roles) extends User; // super parameters class Temp(final double celsius) { this : assert(celsius > -273.15); } // validation ``` Widgets too (compile-checked): ```dart class const Greeting({super.key, required final String name}) extends StatelessWidget { @override Widget build(BuildContext context) => Padding(padding: const .all(16), child: Text('Hi $name')); } ``` `var`/`final` in the header creates a field. Without it, the parameter is just a parameter. Since 3.13, `final`/`var` on ordinary function parameters is a compile error. - **Concise constructors