Many of you stayed up late last night to watch The Flutter Engage conference, where the Flutter team officially announced Flutter 2. It took a little more than two years from the official Flutter 1.0 to Flutter 2. But in such a short time, the Flutter team closed a total of 24,541 issues and merged 17,039 PR with the contributions of 765 contributors. Starting with Flutter 1.22 in September, the team closed a total of 5,807 issues and incorporated 4,091 PR with the contributions of 298 contributors.

Flutter 2 brings many exciting features, such as Dart 2.12, air safety, Web, and more. If you can, check out these two articles Announcing Flutter 2 and Announcing Dart 2.12.

Next, let’s take a quick look at what’s exciting about Flutter 2

Web

Now,Flutter WebOfficial debut, complete frombetatostableThe magnificent turn. inFlutter 2Due toFlutter WebThe way,FlutterTake code reuse to another level. So now when you useFlutter 2When you create a new project,webWill become the new support platform.

By taking advantage of the many advantages of the Web platform, Flutter lays the foundation for building rich interactive Web applications. The Flutter team focuses primarily on performance and rendering fidelity improvements. In addition to the HTML renderer, Flutter 2 also adds a new CanvasKit-based renderer. Flutter 2 also adds some web-specific features, such as Link widgets, to ensure that Flutter feels like a Web application when it runs in a browser.

To learn more about Flutter Web you can read Flutter Web Support hits the Stable Milestone.

Sound Null Safety

Security is an important addition to the Dart language, which further enhances the type system by distinguishing between nullable and non-nullable types. This enables developers to prevent NULL error crashes (NPE), which is a common cause of application crashes. By incorporating null checks into the type system, you can catch these errors during development and prevent production crashes. Since Flutter 2 based on Dart 2.12, Flutter has started to fully support air-to-air. For more details, see Announcing Dart 2.12.

There are over 1000 air safety development kits available on Pub. dev, so start trying to upgrade to Flutter 2. If you are the author of a development package, see the Migration guide and start providing air safety support for your development package.

desktop

In this release, Flutter Desktop is available in beta and Flutter Desktop is marked with an earlier release. This means that Flutter is ready for you to try your hand at developing Desktop applications with Flutter: you can think of Flutter Desktop as a “beta snapshot” to preview the final stable version that will be released later this year.

I’ll fill in on more desktop improvements and features later.

New iOS features

While the Flutter team has been working on improving the quality of support for other platforms, don’t be fooled into thinking that they have left iOS behind. In fact, 178 ios-related PR were consolidated in this release, including 23495 that brought State Restoration to iOS. 67781, which allows us to build IPA directly from the command line without having to open Xcode. 69809, which updates the CocoaPods version to match the latest tools. In addition, some iOS widgets have been added to the Cupertino implementation.

New search box for iOSCupertinoSearchTextField

CupertinoFormSection CupertinoFormRow and CupertinoTextFormFieldRow, these a few new widget can more easily generate more iOS forms of aesthetic feeling.

In addition to working on bringing new features to iOS, the Flutter team is also working on ways to improve the performance of shaders and animations on iOS and Flutter. IOS remains the main platform for Flutter, and the Flutter team will continue to work hard to bring new features and performance improvements to Flutter.

New widgets: Autocomplete and ScaffoldMessenger

AutocompleteCore is the smallest unit to support auto-complete.

Autocomplete is autofill, which is very useful.

Now you can use Autocomplete directly. If you are interested in the design of this feature, you can read the Autocomplete design documentation.

(docs.google.com/document/d/…).

As such, ScaffoldMessenger has been created to address a number of issues related to SnackBars, including the ability to easily create SnackBars in response to AppBar actions, create SnackBars that persist between scaffolds transformations, And the ability to display SnackBars functionality even if the user navigates to a page with other scaffolds when the asynchronous operation is complete.

With all these benefits, we can implement displaying SnackBar with just a few lines of code:

finalmessenger = ScaffoldMessenger.of(context); Messenger. ShowSnackBar (SnackBar (content: Text (" I can fly. ")));Copy the code

With ScaffoldMessenger, of course, you can watch this video for more details.

There is too much to write. More in the evening.