Google introduced Flutter 2 framework and Dart 2.12 language

Google introduced the Flutter 2 user interface framework, which marked the transformation of the project from a framework for developing mobile applications into a universal framework for creating any type of programs, including desktop programs and web applications.

Flutter is seen as an alternative to React Native and allows you to release applications for different platforms based on the same codebase, including iOS, Android, Windows, macOS and Linux, as well as applications to run in browsers. Previously written in Flutter 1 mobile applications after switching to Flutter 2 without rewriting the code can be adapted to work on the desktop and on the Web.

The bulk of the Flutter code is implemented in Dart, and the runtime engine for running applications is written in C++. When developing applications, in addition to Flutter's native Dart language, you can use the Dart Foreign Function interface to call C/C++ code. High runtime performance is achieved by compiling applications to native code for target platforms. At the same time, the program does not need to be recompiled after each change - Dart provides a hot reload mode that allows you to make changes to a running application and immediately evaluate the result.

Flutter 2 announced full support for creating applications for the Web, suitable for production deployments. Three main scenarios for using Flutter for the Web are mentioned: developing stand-alone web applications (PWA, Progressive Web Apps), creating single-page web applications (SPA, Single page apps), and converting mobile applications to web applications. Among the features of development tools for the Web is the use of mechanisms for accelerating the rendering of 2D and 3D graphics, flexible layout of elements on the screen, and the CanvasKit rendering engine compiled into WebAssembly.

Desktop application support is in beta and will be stabilized later this year in one of the next releases. Support for development using Flutter was announced by Canonical, Microsoft and Toyota. Canonical has chosen Flutter as the main framework for their applications and is also using Flutter to develop a new installer for Ubuntu. Microsoft has adapted Flutter for multi-screen foldable devices such as the Surface Duo. Toyota plans to use Flutter for automotive infotainment systems. On the basis of Flutter, the user shell of the Fuchsia microkernel operating system developed by Google is also built.

Google introduced Flutter 2 framework and Dart 2.12 language

At the same time, the release of the Dart 2.12 programming language was published, which continued the development of a radically redesigned branch of Dart 2. Dart 2 differs from the original version of the Dart language by using strong static typing (types can be automatically inferred, so specifying types is not mandatory, but dynamic typing is no longer used and the type computed initially is assigned to the variable and strict type checking is subsequently applied).

The release is notable for the stabilization of the Null safety mode, which will avoid crashes caused by attempts to use variables whose value is not defined and set to Null. The mode implies that variables cannot have undefined values ​​unless they are explicitly set to null. The mode strictly takes into account the types of variables, which allows the compiler to apply additional optimizations. Type matching is checked at compile time, for example, if you try to assign the value "Null" to a variable with a type that does not imply an indeterminate state, such as "int", an error will be displayed.

Another important improvement in Dart 2.12 is the stable implementation of the FFI library, which allows you to create high-performance code from which you can access the C API. Made performance and size optimizations. Added developer tools and code profiling system written using Flutter, as well as new plugins for developing apps with Dart and Flutter for Android Studio/IntelliJ and VS Code.

Google introduced Flutter 2 framework and Dart 2.12 language


Source: opennet.ru

Add a comment