跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

dart-sdk-changelog

Authoritative guide for Dart SDK language specifications, syntax availability, minimum SDK constraints (minSdk), and version changelogs from Dart 1.x through Dart 3.x. Use this skill whenever authoring or refactoring Dart code, inspecting pubspec.yaml sdk constraints, writing control flow (switch statements, pattern matching, switch expressions), implementing class constructors (primary constructors, parameter shorthands), using macros/augmentations, verifying language feature availability against the project's minSdk, or modernizing legacy codebases.

RandalSchwartz · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add RandalSchwartz/dart-sdk-skills --skill dart-sdk-changelog

技能说明


name: dart-sdk-changelog description: >- Authoritative guide for Dart SDK language specifications, syntax availability, minimum SDK constraints (minSdk), and version changelogs from Dart 1.x through Dart 3.x. Use this skill whenever authoring or refactoring Dart code, inspecting pubspec.yaml sdk constraints, writing control flow (switch statements, pattern matching, switch expressions), implementing class constructors (primary constructors, parameter shorthands), using macros/augmentations, verifying language feature availability against the project's minSdk, or modernizing legacy codebases.

Dart SDK Changelog & Version Feature Guide (Dart 1.x to Modern Dart 3.x)

This skill provides an authoritative, structured guide to Dart language features, core library APIs, tooling changes, version requirements, experimental feature flags (--enable-experiment), static metaprogramming (Macros & Augmentations), and legacy modernization runbooks sourced directly from the official Dart SDK CHANGELOG.


🎯 Parent Guide: How to Find the minSdk for Any Dart Feature or API

When writing or reviewing Dart code, selecting the correct minimum SDK lower bound (minSdk) in pubspec.yaml is essential to ensure syntax and core APIs compile across target environments.

1. Language Version vs. SDK Version

  • Language Version (major.minor): In pubspec.yaml, the lower bound of environment.sdk (for example ^3.13.0 or >=3.12.0 <4.0.0) dictates which language grammar and compiler semantics are enabled.
    • Patch numbers (.1, .2) do not affect language grammar.
    • Using a Dart 3.13 feature (like Primary Constructors) requires sdk: '^3.13.0'.
  • Core Library APIs: Methods and classes (for example Future.pause, List.unmodifiableOf) are added in specific SDK versions.
  • Per-file override: A file can specify // @dart = 3.12 on line 1 to force an earlier language version.

2. Fast minSdk Language Feature Matrix

Feature / SyntaxMinimum SDKExample SyntaxReference
this Type Promotion & Join-Point Promotion3.15.0 (beta)if (this is Circle) print(radius);3.15 Guide
Primary Constructors3.13.0class Point(var int x, var int y); / this : assert(...)3.13 Guide
Constructor Keyword Shorthands3.13.0new(this.x); / factory clone(...) => ...;3.13 Guide
Private Named Parameters3.12.0Point({required this._x, required this._y});3.12 Guide
Wildcard Variables (_)3.7.0var (_, b) = pair; / void fn(int _, int _)3.7 Guide
Type Inference Using Bounds3.7.0Inferred types respect type parameter bounds3.7 Guide
Digit Separators3.6.01_000_000, 0x4000_0000, 0.000_0013.6 Guide
Extension Types3.3.0extension type Meters(int value) {}3.0-3.5 Guide
Private Field Promotion3.2.0if (_privateFinalField != null) { ... }3.0-3.5 Guide
Records (Tuples)3.0.0(int, String) pair = (1, 'a');3.0-3.5 Guide
Pattern Matching & Destructuring3.0.0var (a, b) = pair; / switch (val) { case ... }3.0-3.5 Guide
Switch Expressions3.0.0var s = switch (e) { 0 => 'a', _ => 'b' };3.0-3.5 Guide
If-Case Statements & Elements3.0.0if (json case {'id': int id}) ...3.0-3.5 Guide
Sealed Classes & Exhaustiveness3.0.0sealed class State {}3.0-3.5 Guide
Class Modifiers (base, interface, final)3.0.0interface class Api {} / final class Token {}3.0-3.5 Guide
100% Sound Null Safety Enforced3.0.0Non-null-safe mode disallowed3.0-3.5 Guide
Super-Initializer Parameters2.17.0SubClass(super.name, {super.key});Dart 2 Milestones
Enhanced Enums2.17.0enum Status { ok(200); final int c; const Status(this.c); }Dart 2 Milestones
Named Arguments Anywhere2.17.0fn(1, named: 'a', 2);Dart 2 Milestones
Constructor Tear-Offs2.15.0List.filled, Point.newDart 2 Milestones
Triple-Shift Operator (>>>)2.14.0int result = a >>> b;Dart 2 Milestones
Generic Type Aliases (typedef)2.13.0typedef JsonMap = Map<String, dynamic>;Dart 2 Milestones
Sound Null Safety (?, late, !)2.12.0Sound static non-nullable typesDart 2 Milestones
Extension Methods2.7.0extension on String { ... }Dart 2 Milestones
Spread Operators (..., ...?)2.3.0[...list1, ...?maybeList]Dart 2 Milestones
Collection if and for2.3.0[if (cond) a, for (var x in l) x * 2]Dart 2 Milestones
Sound Type System & Optional new2.0.0Static sound types replace dynamic checks[Dart 2 Milestones
阅读完整来源 ↗