Since Flutter has been bundled with the Dart 2 SDK for several months now, it is believed that many Flutter developers have enjoyed many of the advantages of Dart 2 due to the tight coupling between the framework and the language. Is an important milestone.

The release of Dart2 represents a reboot of the Dart language: a mobile and Web development language that aims to become a mainstream one. It focuses on rapid development and outstanding user experiences for mobile and Web applications. Google hopes developers can build efficient client applications, and programming languages can be combined with an efficient, framework, and components reduce boilerplate code, focus on business logic, and Google can provide some early identification errors and realize the powerful debugging and running small and fast runtime tools (runtime) code.

Dart has seen tremendous growth over the past year, with Google reporting a tenfold increase in users over the past year. Dart is making one of the fastest growing language (https://madnight.github.io/githut/#/pull_requests/2018/2).

Inside Google, Dart is also one of the few languages Google uses to develop Web applications, with millions of lines of code from ten different projects, These include Google Ads, Google Shopping, and projects from Google’s internal infrastructure team.

In fact, you’re probably already using Dart, you just don’t see it: Dart is already used in the Sass stylesheet preprocessor (https://sass-lang.com/) to make it faster and easier to write. Sass is distributed as a stand-alone executable on Homebrew and Chocolatey and compiled to pure JavaScript on NPM.

Dart also makes it easy to install applications anywhere without external dependencies, bringing in the developer’s workflow.

Dart 2 aims to optimize language development, enhance Google’s support for Web and mobile frameworks, and bring some of Google’s darT-enabled tools and components to external developers, Google said.

As Google announced earlier this year, Dart has a robust, complete ecosystem, which means a lot of problems can be found at compile time before you even run your application. Google says that when it applied Dart to very large applications in Google, it caught bugs early in development, saved them a lot of trouble later, and kept the quality of the code.

With Dart 2, expression values don’t match expression static types anymore, which means you can scale your code to millions of lines, handle large refactoring projects, and deploy your code efficiently.

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> }Copy the code

Web applications have been central to Dart’s mission from the beginning, and in fact, most of Google’s Dart development has been for Web applications. One of the most important is Google Ads, which is powering the multibillion-dollar Web economy. In migrating code to Dart, Google reduced the amount of UI code by 40 percent while improving developer productivity and application quality.

The Dart SDK not only provides many libraries to access modern browser apis, but also supports the Angular framework for building complex Web applications.

AngularDart 5 (https://webdev.dartlang.org/angular) as part of the Dart 2, it makes full use of the Dart type system and a new build system (see below) in the development process to provide rapid increment of build, It also provides JavaScript compilation during deployment.

Google says its investment in the framework has expanded to include core components, which can now be accessed at https://dart-lang.github.io/angular_components_example/

Dart 2 makes Dart a programming language for compiling JavaScript with the development cycle and runtime performance that Web developers have come to expect. It also has the same advantages as most JS target languages: a rich type system and strong support for native mobile applications.

Developed using Dart 2, the Web tool uses a pure JavaScript development model and two complementary JavaScript compilers. The development compiler Dartdevc provides fast incremental compilation while generating JavaScript that is easy to read and debug. This allows the generation compiler dart2js to focus on generating highly optimized JavaScript for the PWA of mobile applications on the desktop.

Dart’s Web tools are based on a new build system designed to be fast, debuggable, and extensible. Now, tasks like compiling Sass to CSS or compiling Dart to JavaScript happen in a toolchain that allows for rapid incremental updates as you change parts of your application. The build system is also designed to support applications outside the Web. For example, Flutter developers use it to generate JSON serialization code.

Dart 2 also has an extended set of development tools. In addition to support for Android Studio and JetBrains suite tools, including IntelliJ IDEA and WebStorm, Visual Studio Code with the Dart Code extension is also supported.

Finally, the Dart SDK comes with other useful tools: a package manager that works with a package site, a static analyzer, a Linter that works as a package, and tools for editing Web documents and code formats that conform to the Dart style guide.

Finally, Google says Dart Announcements will be displayed on Dart Announcements. If you have any questions about Dart 2, contact the Gitter community.

1. The Gitter: https://gitter.im/dart-lang/home

2. The Dart Announcements:https://groups.google.com/a/dartlang.org/forum/#! forum/announce

3. The Dart style guide:https://www.dartlang.org/guides/language/effective-dart/style

4. New build system for Dart: https://github.com/dart-lang/build

5. Package site: https://pub.dartlang.org/

6. Static parser: Xda-developers.com

7. dart2js:https://webdev.dartlang.org/tools/dart2js

8. dartdevc:https://webdev.dartlang.org/tools/dartdevc

9. The original link: https://medium.com/dartlang/dart-2-stable-and-the-dart-web-platform-3775d5f8eac7