Dart 2.14 and Flutter 2.5 are now available.

Google has released Dart programming language version 2.14, continuing the development of a fundamentally redesigned branch of Dart 2, which differs from the original version by employing strong static typing (types can be inferred automatically, so specifying types is not mandatory, but dynamic typing is no longer used and the originally inferred type is locked to the variable, with strict type checking applied thereafter).

Features of the Dart language:

  • Familiar and easy-to-learn syntax, natural for programmers coming from JavaScript, C, and Java.
  • Ensuring quick startup and high performance for all modern web browsers and various environments, from mobile devices to powerful servers. servers.
  • Ability to define classes and interfaces, allowing for encapsulation and reuse of existing methods and data.
  • Type specification simplifies debugging and error detection, makes the code clearer and more readable, and eases further development and analysis by external developers.
  • Supported types include various types of hashes, arrays and lists, queues, numeric and string types, types for defining date and time, and regular expressions (RegExp). There is an option to create custom types.
  • For organizing concurrent execution, it is suggested to use classes with the isolate attribute, whose code runs entirely in an isolated space in separate memory, interacting with the main process via message passing.
  • Support for libraries that simplify maintenance and debugging of large web projects. Third-party function implementations can be included as shared libraries. Applications can be divided into parts, allowing each part to be developed by separate teams of programmers.
  • A set of ready-made tools to support development in Dart, including implementations for dynamic development and debugging with on-the-fly code fixes (‘edit-and-continue’).
  • To simplify development in the Dart language, an SDK, a package manager pub, a static code analyzer dart_analyzer, a set of libraries, the integrated development environment DartPad, and Dart support plugins for IntelliJ IDEA, WebStorm, Emacs, Sublime Text 2, and Vim are provided.
  • Additional packages with libraries and utilities are distributed through the pub repository, which contains more than 20,000 packages.

Key changes in the Dart 2.14 release:

  • A new triple shift operator (>>>) has been added, which performs a logical shift rather than an arithmetic one, working without regard to the sign bit (the shift occurs without differentiating between positive and negative numbers).
  • The restriction on type arguments has been removed, allowing generic function types to be used as arguments with type. For example, you can now specify: late List<T Function(T)> idFunctions; var callback = [(T value) => value]; late S Function<S extends T Function(T)>(S) f;
  • It is now allowed to specify type arguments in annotations, such as @Deprecated. For instance, you can now write: @TypeHelper(42, "The meaning")
  • The standard library (core) has added static methods hash, hashAll, and hashAllUnordered to the Object class. In the DateTime class, the handling of local time has been improved when converting hours between daylight saving and standard time that is not a multiple of one hour (for example, Australia uses a 30-minute offset). The ffi package has added support for the arena memory allocation mechanism, which automatically frees resources. The ffigen package has added the ability to generate typedef definitions of Dart types from C.
  • 250 of the most popular packages from the pub.dev repository and 94% of the top 1000 have been translated to use the null safety mode, which helps avoid crashes caused by attempts to use variables with undefined values set to null. The mode implies that variables cannot have undefined values unless explicitly assigned a null value. The mode strictly considers variable types, allowing the compiler to apply additional optimizations. Type compliance is checked at compile time; for example, an error will be raised if an attempt is made to assign a null value to a variable of a type that does not allow an undefined state, such as int.
  • Unified rule sets for the code analyzer (linter) have been proposed, providing simultaneous support for enforcing code style guidelines for Dart and the Flutter framework. Historically, the code formatting rules for Flutter and Dart differed; moreover, for Dart, there were two common rule sets — the pedantic rules from Google and the community-developed rules. In Dart 2.14, a new common linter rule set has been introduced, which is intended to be used by default in new Dart projects and in the Flutter SDK. The set includes basic rules (package lints/core.yaml), recommended additional rules (lints/recommended.yaml), and Flutter-specific recommendations (flutter_lints/flutter.yaml). Users of pedantic rules are encouraged to transition to the new coding style based on the recommendations from Dart's documentation.
  • The formatter has been optimized for formatting cascade blocks of code, significantly enhancing formatting performance and avoiding ambiguous interpretations of the expression's element ownership. For example, the call '..doIt' in the expression 'var result = errorState ? foo : bad..doIt()' pertains not to the conditional part of the 'bad' block but to the entire expression; thus, it is now formatted as: var result = errorState ? foo : bad ..doIt();
  • Support for Apple M1 (Silicon) processors has been added to the SDK, allowing not only the execution of the Dart VM, utilities, and SDK components on systems with Apple Silicon processors but also support for compiling executable files for these chips.
  • The "dart pub" command now supports a new service file ".pubignore", which allows you to specify a list of files that will be skipped when publishing a package to the pub.dev repository. The specified settings do not overlap with the ".gitignore" ignore list (in some situations, pub.dev requires not to send files that are needed in Git, for example, internal scripts used during development).
  • Work has been done to improve the performance of the "dart test" command, which now does not require recompiling tests after changing the pubspec if the version number has not changed.
  • Support for compilation in ECMAScript 5 compatibility mode has been discontinued (this change will lead to a loss of compatibility with the browser IE11).
  • The stagehand, dartfmt, and dart2native utilities have been deprecated, replaced by built-in commands invoked through the dart utility.
  • The VM Native Extensions mechanism has also been deprecated. To call native code from Dart, it is recommended to use the new Dart FFI (Foreign Function Interface).

At the same time, a significant release of the Flutter 2.5 user interface framework has been presented, which is seen as an alternative to React Native and allows building applications for iOS, Android, Windows, macOS, and Linux from a single codebase, as well as creating applications for the web. Flutter is the underlying technology for the user shell of Google's microkernel-based operating system Fuchsia.

The core of Flutter's code is implemented in Dart, while the runtime engine for executing applications is written in C++. In addition to Dart, the native language for Flutter, developers can utilize the Dart Foreign Function interface to call code written in C/C++. High performance is achieved through compiling applications to machine code for the target platforms. Importantly, programs do not need to be recompiled after each change as Dart provides a hot reload mode, allowing changes to be made in a running application and evaluated immediately.

Key changes in Flutter 2.5:

  • Significant performance optimizations have been made. On iOS and macOS platforms, shader precompilation for the Metal graphics API has been implemented. The efficiency of asynchronous event processing has increased. The issue with delays during garbage collection when freeing memory from unused images has been resolved (for example, during the playback of a 20-second animated GIF, the number of garbage collection operations has been reduced from 400 to 4). Message transfer delays between Dart and Objective-C/Swift (iOS) or Java/Kotlin (Android) have been reduced by up to 50%. Native build support has been added for Apple Silicon-based systems.
    Dart 2.14 and Flutter 2.5 are now available.
  • Full-screen mode support for applications has been established on the Android platform. The implementation of the 'Material You' design concept continues, presented as a next-generation variant of Material Design. A new state, MaterialState.scrolledUnder, has been added, enabling dynamic display of scrollbars on resizing, along with a new interface for displaying notification banners.
  • The camera plugin's capabilities have been significantly expanded, now featuring tools for controlling autofocus, exposure, flash, zoom, noise reduction, and resolution.
  • Developer tools (DevTools) have been improved, featuring an updated widget inspection mode and tools for identifying rendering delays and tracking shader compilation.
    Dart 2.14 and Flutter 2.5 are now available.
  • Plugins for Visual Studio Code and IntelliJ/Android Studio have been enhanced.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster