Announcing Dart 2 Stable and the Dart Web Platform

Signals the rebirth of Dart as a mainstream programming language for mobile and web development

Kevin Moore


Today, we’re announcing the immediate availability of the stable release of Dart 2, including a rewrite of the Dart web platform that offers a unique combination of productivity, performance and scalability.

Flutter developers are already enjoying many of the benefits of Dart 2, since Flutter has been bundling prerelease versions of the Dart 2 SDK for several months. However, the stable release of Dart 2 is another important milestone towards the stable release of Flutter, due to the tight coupling between framework and language. If you haven’t already installed Flutter, start here.

With the release of Dart 2, web developers can now leverage the same language, libraries and tools along with a number of web-specific enhancements. Web developers should start at the Get Started page for instructions on installing tools and building a first application.

Dart: Growing Excitement

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. We want to enable developers building client applications to be productive, with a language, framework and components that reduce boilerplate and let them concentrate on the business logic, along with tooling that identifies errors early, enables powerful debugging and delivers small, fast runtime code.

Over the last year, Dart has seen dramatic growth. Our own analytics suggest a ten-fold growth in external usage. In the last quarter, Dart was one of the fastest growing languages on GitHub, as measured by pull requests; the growth of StackOverflow questions also provides a vivid demonstration of Dart’s momentum:

Internally, Dart is one of a handful of languages Google uses for web application development, with millions of lines of code from dozens of different projects including Google Ads, Google Shopping and our own internal infrastructure teams.

In fact, you might already be using Dart without realizing it: the popular Sass stylesheet preprocessor was recently rewritten in Dart to make it faster, more portable, and easier to write. Sass is now distributed as a standalone executable on Homebrew and Chocolatey, and compiled to pure JavaScript on npm. Dart makes it easy to install applications anywhere without external dependencies, and to slot into the workflows of both people who use Dart and people who don’t.

Dart 2 is focused on three areas: strengthening and tightening the language, developing our support for web and mobile frameworks, and bringing some of the tooling and components that support Google’s usage of Dart to the outside world. The rest of this post will explore these themes.

Dart 2: A Client-Optimized Language

As we highlighted in February, the Dart type system is sound. This means that a large class of issues is found before your users run your application — during analysis and compilation. As we scaled Dart to extremely large apps within Google, the type system caught more errors early in the development cycle, leading to higher quality production code.

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. This means that you can scale your codebase to millions of lines, tackle large refactoring projects, and deploy your code with confidence.

Don’t worry: soundness doesn’t mean mountains of boilerplate. The type system includes advanced inference — even for generic type arguments.

final _field = [3.14, 6.28];void main() {
// No type parameter is provided, but <int> is inferred
print([1, 2, 3].runtimeType); // List<int>
// If types are unmatched, their common base type is used
// int (1) and double (3.14) are both `num`
print([1, 3.14].runtimeType); // List<num>
// Inference goes beyond variables.
// You can omit types on fields, too.
print(_field.runtimeType); // List<double>

To learn more about the Dart 2 type system, check out this page.

As mentioned in previous blog posts, Dart 2 also reduces the language ceremony in a few key areas: for example, the new keyword is now optional, and the const keyword is optional within a constant context.

Lastly, we’ve done lots of work behind the scenes to unify various supporting tools, with a common front-end that now supports our compilers and runtimes. This ensures consistency for our users now and promises to improve the velocity and quality of new features as Dart continues to evolve.

Dart on the Web: A Rich, Powerful Framework

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. In the process of migrating their code to Dart, they reduced the size of their UI codebase by 40% while improving developer productivity and application quality.

While the core Dart SDK provides libraries to access modern browser APIs, we also support a robust Angular-inspired framework for building complex web applications. AngularDart 5, shipped as part of Dart 2, takes advantage of Dart’s sound type system and the new build system (described below) to offer fast incremental builds during development and smaller compiled JavaScript when you’re ready to deploy.

One major area of focus for this release has been improving the amount of code that is processed on page load, significantly reducing the ‘time to interactivity’ for web pages. Many apps have seen code size reduced by more than half compared to AngularDart 4.

To showcase the improvements in Dart’s web platform, we built out a Dart-based client implementation for the HackerNews site as a Progressive Web App; this is published along with other sample implementations at the popular HNPWA site. Using best practices for building Dart web apps, we were able to ship a full-featured experience that is fully interactive in one second on modern devices and under five seconds on a modest mobile device on a slow 3G network. This is competitive even with lightweight web frameworks that are optimized for smaller apps.

Our framework investments extend to our core components, which we’ve also updated. You now have access to 100 new classes, including a number of date, time, and menu Material components. You can explore all of our components in the component gallery.

Material Date Picker — one of the rich components available for your web application

Flexible Tooling for Dart 2

With Dart 2, Dart becomes a first-class compiled-to-JavaScript language, with a dev cycle that web developers expect and excellent runtime performance characteristics. This is done while providing benefits most JS-targeted languages don’t provide: a sound type system and excellent support for native mobile apps.

With Dart 2, our web tools embrace a 100% JavaScript development model with two complementary JavaScript compilers. The development compiler, dartdevc, provides fast incremental compilation while generating JavaScript that is easy to read and debug. This allows our production compiler, dart2js, to focus on producing highly optimized JavaScript for progressive web apps for mobile and complex enterprise experiences for the desktop. Both compilers leverage Dart’s sound type system to optimize their output.

Our web tools are based on a new build system, designed to be fast, debuggable, and extensible. Now tasks like generating serialization code, compiling Sass to CSS and compiling Dart to JavaScript happen in one toolchain that supports fast, incremental updates as you change parts of your application. The build system is also designed to support uses beyond the web. An example: it’s being used by Flutter developers, to generate JSON serialization code.

With Dart 2, we also have an expanded set of developer tools. In addition to support for Android Studio and the JetBrains suite of tools, including IntelliJ IDEA and WebStorm, we also support Visual Studio Code with the Dart Code extension. And we also have a great scratchpad for experimenting: DartPad, which has been fully updated for Dart 2.

Finally, the Dart SDK comes with a suite of other useful tools: a package manager that works with our package site, a static analyzer, a linter that you can consume from the command line or as a package, and tooling for web documentation and code formatting that conforms with the Dart style guide.

Learn more

Check out the instructions for getting started with Flutter and the Dart web toolset.

The release notes provide a detailed technical breakdown of the numerous other smaller improvements made since Dart 1, some of which are breaking changes for older Dart code. If you run into problems that a Google search can’t solve, we recommend starting at StackOverflow. Subscribe to the Dart Announcements mailing list and follow us on Twitter to get updates. We’d also love to see you in our communities, for example the Gitter chat room and r/dartlang subreddit.

Thank you

Dart has become a general purpose language that is optimized for web and mobile development. We’ve been working on Dart 2 for several years, during which time it has touched every aspect of our ecosystem and required migrating millions of lines of code and hundreds of packages.

We are grateful to the Dart and Flutter communities and well as the hundreds of Google engineers who have helped us on this journey. We couldn’t have done it without you!



Kevin Moore
Editor for

Google Product Manager working on Dart and Flutter web technologies. Find all of my social links at