📜 ⬆️ ⬇️

Dart 1.9. The release you have been waiting for

The new release is mostly about simplifying asynchronous programming. In modern applications, it is everywhere - it is user interaction, with the network, file I / O, etc. The new release of Dart has greatly simplified working with such scenarios by entering async / await .

Async methods and await expressions are made based on the familiar Future API , you can use them with loops, conditional expressions, and try / catch blocks to control complex asynchronous interactions. Read more about async / await in the Dart Language Asynchrony Support article : Phase 1 ( translation ).

So the asynchronous code looked using the Future API :


So the code looks like with the arrival of a new release and async / await :

')
New generators were also introduced - sync * and async * , which simplify the left generation of sequences and eliminate the need for developers to create their own iterators in many cases. Read more in the Asynchrony Support: Phase 2 article.

Among other innovations:

A complete list of innovations can be found in release notes .

Download the latest Dart release on the site.

Source: https://habr.com/ru/post/254229/


All Articles