Update: Google has released an official announcement for Dart 2’s release. This article has been updated with relevant info.
The release of Dart 2 has been anticipated by developers since it was first announced, back in February. The excitement reached a fever pitch late last month, when it was teased that Dart 2’s release was in the “immediate future” and that package authors should migrate their code as soon as possible.
Dart 2 marks the rebirth of Dart as a mainstream programming language focused on enabling a fast development and great user experiences for mobile and web applications.
Coming from Dart 1, there’s two major developer-facing changes, the largest of which is a stronger type system, including runtime checks to help catch errors that would arise from mismatched or incorrectly labeled types. This type system, originally called “strong mode”, has long been the default in Flutter.
With Dart 2, you can’t get into a state where an expression evaluates to a value that doesn’t match the expression’s static type.
The other is an interesting quality-of-life change for Flutter developers, which allows creating an instance of a class without the “new” keyword. The goal of this change is to make Flutter code more readable, less clunky, and easier to type, but the principle applies to all Dart code. There have been plenty of other improvements happening under the hood, as can be seen in the official changelog.
Web applications have been central to Dart’s mission from the start. In fact, most Dart development at Google is for web applications. One of the biggest is Google Ads, which powers billions of dollars of the web economy.
Both Fuchsia and Flutter have used pre-release versions of Dart 2 for some months now, desiring to be ahead of the curve, with Fuchsia removing support for Dart 1 in April. That being the case, this release is targeted more at web and server developers, and is merely an interesting milestone for Flutter developers, who should know that releasing Dart 2 Stable is necessary before Flutter can leave beta.