Google I/O 2023 - a quick summary of the current status and future of Flutter & Dart

With the release of Google I/O 2023, Flutter 3.10 and Dart 3.0 are also officially released. I have to say that the version number of Dart is finally catching up with the version number of Flutter . Especially with the release of Dart 3, Flutter is in records and With the blessing of patterns, the development experience has finally begun to enter the process of modern languages.

For Flutter developers, Flutter 3.10 and Dart 3.0 can be said to be a new watershed , the detailed introduction can be found in the link below, and then we will briefly summarize it.

Flutter 3.10 released: https://carguo.blog.csdn.net/article/details/130613683?spm=1001.2014.3001.5502

The official release of Dart 3: https://blog.csdn.net/ZuoYueLiang/article/details/130619314

Flutter 3.10

Strictly speaking, Flutter 3.10 is not a major update, because it is not 4.0 as everyone imagined, but 3.10 also brings important changes: iOS starts to use Impeller by default .

In version 3.7, Impeller was introduced to replace Skia in the future. The reason is that the Flutter team faced more and more problems on Skia and could not effectively and quickly advance, so it embarked on the road of self-developed Impeller, and the effect is also remarkable:

Most of the pages updated in 3.10 are focused on iOS. It can be seen that performance problems on iOS have been plaguing the Flutter team, and Impeller is the solution.

So you ask me if I can use Impeller by default after upgrading to 3.10? My answer is no . For production projects, the first thing to do when upgrading to 3.10 is to FLTEnableImpellerset false, because according to historical rules, the relatively more stable Impeller probably starts from 3.10.6.

It is recommended to put Impeller into production in the next version, and personal projects can start beta in advance.

Of course, it is necessary to gradually intervene in Impeller, because there is a high probability that Skia on iOS will start to be eliminated in the next version.

Another practical thing is to support Xcode wireless debugging.

In addition, there are a large number of Material 3 controls in this update, such as new additions such as NavigationBar, andNavigationDrawer , as well as modifications to , and , but I believe that most domestic developers are not very concerned about M3 .SearchBarDatePickerTimePickerBottomSheet

At present, you need to pass under MaterialAppthe theme configuration useMaterial3to enable M3, but the next version will become the default, so it is recommended to write this version firstuseMaterial3:false , anyway, the domestic designers I know do not recognize M3.

This time also provides a flamboyant API ColorScheme.fromImageProviderto generate corresponding images from pictures ColorScheme. I just think that everyone will use it to configure theme colors and use them?

By the way, the default color is now purple.

The main change of the web is to support fragment shader and nest flutter web under other web without iframe . At present, the future of flutter web still lies in Dart.

The WebAssembly native code that Dart 3 starts to preview and support is the official mainstream direction in the future, that is, the htmlcanvas mode will gradually become "non-mainstream" .

Compiling the new Dart to Wasm module will provide a better experience in terms of loading time, performance, and consistency. At the same time, for browser teamwork, the new WasmGC specification will be built into the ecosystem to achieve a true native web.

Then you can meet, with the release of Flutter 3.10, the future route of Flutter will become clearer:

  • More stable iOS Impeller
  • Impeller supports Android
  • Skia is out of the stage of history
  • Web Scales to CanvasKit With Dart Native Wasm Support
  • PC and Web with Skia and mobile with Impeller will have more pronounced rendering differences.

Finally, I have to say that Flutter is going further and further on the road of game support, and like last year, this year also released the warm-up mini-game I/O FLIP , which is a card game designed using AI. The two I/O games are still built using Flutter and Firebase . The overall experience is like the Demo version of Hearthstone.

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-wOBoKDdP-1683779864487)(/Users/guoshuyu/Desktop/IO/IOFLIP gif (1)]-min-3 .gif)

Combined with the real 3D game demo demonstrated at the previous 2023 Flutter Forward conference , it can be seen that Flutter will continue to make efforts in the game field in the future, and look forward to better game answers at I/O next year.

Dart 3

The arrival of Dart 3 can actually be met, because since Flutter Forword released the Dart 3α preview , everyone has a certain concept of Dart 3, the most important of which is that null safety is now mandatory.

Maybe you will say that it is not null safety for a long time? But now Dart 3 is mandatory null safety, that is, to remove support for running without sound null safety .

In fact, I have seen that many comrades are still using the non-null safety Dart, it is time to upgrade, and they cannot escape.

The productivity brought by Record, patterns and class modifiers is not much to say here. If you are just interested, you can go to the detailed introduction above. With the addition of Record, patterns and class modifiers, Dart finally gradually walks in the syntactic sugar of modern languages . On the right track, although it is still a "rookie", it is slowly standing up .

For the future, Dart has two main directions:

  • Native interop: Now dart:ffithat , such as Java and Kotlin interop , Objective-C and Swift interop , etc., then in the future, can it be realized directly through native interop without writing Plugin? Most of the database implementations on Dart now support access to ffi.
  • Metaprogramming support: For example, json serialization support has always been a criticism of dart, but the scale and inherent risks of metaprogramming are currently being explored by the Dart team in a more effective and thorough way. Although there is no specific time, it is still There is something to look forward to .

In general, the positioning of Dart is also expanding from the field of Flutter. For example, the backend of the I/O game mentioned above is also written in Dart. Currently, the well-known databases on pub.dev also support separate use without Flutter.

at last

Although Flutter & Dart is not the protagonist of Google I/O this time, you can feel the sincerity of the Flutter and Dart teams. Flutter and Dart are also gradually realizing the promises made at the Flutter Forward conference, and at the same time gradually showing users their future possible.

Finally, one thing can be made clear: Flutter 3.10 and Dart 3 still have pitfalls, but this will not be their end, and the future of Flutter and Dart will be even more exciting .

Guess you like

Origin blog.csdn.net/ZuoYueLiang/article/details/130619319
Recommended