Published July 19, 2026
Dart 3.13 Arrives with Stable Primary Constructors — Major Language Milestone
The Dart team has shipped Dart 3.13, a release that graduates primary constructors from experimental preview to a fully supported language feature. The new SDK, available since July 14, 2026, marks one of the most significant quality-of-life improvements for Dart developers since null safety landed in Dart 2.12.
Primary constructors let you declare a class's fields and its main constructor in a single line in the class header, rather than writing a separate constructor body and field declarations. For Flutter developers who write dozens of small widget and model classes per project, the savings add up quickly.
What Primary Constructors Look Like in Practice
Instead of the traditional pattern where you declare fields, write a constructor, and use this. initializing formals across multiple lines, Dart 3.13 allows you to collapse the entire class into its header:
class Point(final int x, final int y);
This single line replaces what used to take five lines or more. The feature works with named parameters, positional parameters, default values, and even const constructors. A const version would be written as class const Insets(final double value);, preserving compile-time constant semantics that Flutter relies on heavily for widget optimization.
The call site does not change at all. Every existing caller that writes Point(1, 2) or Insets(8.0) continues to work without edits. This means teams can adopt primary constructors incrementally without breaking their public API.
From Experimental to Stable: The Road Through Dart 3.12
Primary constructors were first introduced as an experimental preview in Dart 3.12, which shipped alongside Flutter 3.44 at Google I/O 2026 in May. During the preview period, the feature required an explicit opt-in via analysis_options.yaml and a command-line flag passed to the Dart compiler and formatter. Many teams experimented with the syntax and provided feedback that shaped the final design.
The key changes between the experimental and stable versions are subtle but important. The syntax rules for how super parameters interact with primary constructors have been tightened, and the analyzer now produces more helpful diagnostics when a primary constructor's parameter list conflicts with an explicitly written constructor in the same class. The formatter also handles the new syntax more gracefully, keeping alignment consistent across different class shapes.
To use primary constructors in Dart 3.13, you simply set your package's SDK constraint to ^3.13.0 or higher. No experimental flags are needed. The analyzer, formatter, and all Dart tools recognize the syntax out of the box.
- Zero boilerplate for simple data classes — A class that holds a few values and does nothing else can be expressed in a single line, making immutable data models much easier to read and maintain
- Works seamlessly with inheritance — Primary constructors support
superparameters, so subclasses can delegate to their parent's primary constructor without writing explicit initializer lists - Full const support preserved — The
constkeyword moves to the class header position, keeping compile-time constant behavior that Flutter depends on for efficient widget rebuilds
What Else Ships in Dart 3.13
Beyond primary constructors, Dart 3.13 includes several library and tooling improvements that polish the daily development experience. The dart:core library gains new utility methods for working with records and sealed types, reflecting the growing adoption of these features throughout the ecosystem. The dart:io library sees improvements to file system watching on macOS, making hot reload more reliable during development sessions.
On the tooling side, the Dart analyzer has been updated with new lint rules that catch common mistakes when migrating to primary constructors. The linter can flag cases where a hand-written constructor could be replaced by a primary constructor, and it warns when a class mixes primary constructor parameters with an explicit constructor body in ways that could lead to confusion. The formatter has also been updated to handle the new syntax consistently, ensuring that teams adopting primary constructors get clean, uniform formatting across their codebase.
The Dart Development Compiler (DDC) and dart2js have both received stability improvements, with better error messages when compilation fails due to primary constructor misuse. The dart2wasm compiler continues to mature, with improved support for the new syntax in WebAssembly output.
- New lint rules help teams identify constructor boilerplate that can be simplified with primary constructors
- Improved error messages in the compiler toolchain when primary constructor syntax is used incorrectly
- Better formatter alignment for classes that combine primary constructors with additional methods or fields
Migration Strategy for Flutter Teams
For teams managing large Flutter codebases, the question of how and when to migrate is an important one. The Dart team has published guidance recommending a phased approach. Start by using primary constructors in new files and newly created classes. This gives developers a chance to become comfortable with the syntax without risking widespread disruption.
For existing classes, automated migration tools are available. Community tools like Andrea Bizzotto's migration CLI can transform a codebase in seconds, preserving constructor shapes, const semantics, and public API signatures. The tool handles edge cases like factories, named constructors, and classes with both a primary constructor and additional explicit constructors.
It is worth noting that primary constructors are not always the right choice. Classes with multiple named constructors, complex initialization logic, or validation in the constructor body are better served by the traditional syntax. The feature is designed to augment, not replace, Dart's existing constructor system.
The advent of stable primary constructors in Dart 3.13 represents a maturing of the language that directly benefits Flutter developers. By cutting boilerplate without sacrificing expressiveness, Dart continues to position itself as one of the most productive languages for cross-platform UI development. The Flutter ecosystem is already seeing a wave of package updates that adopt the new syntax, and the community response has been overwhelmingly positive.