Dart 2.0 Updates

Send feedback

This page has information about changes that are coming in Dart 2.0, and how you can migrate your code from Dart 1.x:

Here’s what’s different in Dart 2.0:

Migration tips: web

If you develop for the web, you can start migrating to Dart 2.0 now:

Convert your code to be strong mode compliant.
For more information, see Strong mode and static typing, below.
Optimize the structure of your libraries.
Place library code that won’t be directly imported by your web code, or by other packages, under lib/src. For more information, see the documentation for creating library packages. You can find examples of this directory structure in the Stagehand templates.

Migration tips: servers and command-line scripts

If you develop servers or command-line scripts, you can start migrating to Dart 2.0 now:

Convert your code to be strong mode compliant.
For more information, see Strong mode and static typing, below.

Obsolete features

The following features are redundant and won’t be in Dart 2.0:

Checked mode
Strong mode replaces checked mode. To learn how they differ, see What is the difference between strong mode and checked mode?
Dartium
The dartdevc compiler performs fast compiles to JavaScript, thanks to strong mode. Instead of Dartium, you’ll use Chrome or other standard browsers for testing. For information on Dartium’s removal, see A stronger Dart for everyone.

Strong mode and static typing

Dart 1.x is an optionally typed language, but types aren’t optional in Dart 2.0. With both static and runtime type checks, Dart 2.0 has a sound type system.

Thanks to strong mode, the Dart analyzer can find bugs earlier in the development cycle, and types are checked at runtime.

Migrate your code to strong mode, and you may identify some lurking bugs that are now more easily identifiable and addressable. You’ll also find it much easier to transition to Dart 2.0. For more information, see A stronger Dart for everyone and Strong Mode Dart.

To use strong mode in Dart 1.x, you must enable it. Note that runtime checks are not yet available unless you are developing for the web and using dartdevc.