Enumerations ( enum )

) Asynchrony ( async , await , and more)

, , and more) Deferred loading ( import ... deferred as )

Enums

enum FormState { OPEN, INPROGRESS, CLOSED }





Async

checkVersion() async {

var version = await lookUpVersion();

if (version == expectedVersion) {

// Do something.

} else {

// Do something else.

}

}

Deferred loading

Enjoy!

Support for enums, async, and deferred loading are now officially part of the 2nd revision of the Ecma-408 standard , the Dart Programming Language Specification. The second revision was approved last week at the Ecma General Assembly.You can find more information about using the new features in our language tour on dartlang.org:Enums help developers express clear intent with minimal code, and help tools catch potential bugs. Here is an example of an enumeration of form states:Tools can even warn developers if they omit an enum value from a switch statement, which helps identify potential bugs.Dart has always had strong support for asynchronous programming, with core library features such as Future and Stream . Now, with the new language primitivesand, asynchronous code is much easier to read and write.The following code is easy to read, because a developer can follow the logic, line by line. However, thefunction actually runs asynchronously!Users expect web applications to load extremely quickly. Dart's newsyntax helps a developer send minimal code to the client on the initial download, and load extra functionality on demand. This means that the user downloads only the code that they need to get started, resulting in faster load times.We are excited about these new language features and are working hard to provide full-fledged implementations of the new features in the Dart SDK as soon as possible. We look forward to your feedback on the new features.