Flutter 2.0 major update

Good text recommended:
Author: Laomeng Flutter
link: https: //juejin.cn/post/6935818012490465293

Lao Meng's guide : Yesterday the long-awaited Flutter 2.0 was finally released, and the web side was finally corrected. In an article I published during the spring, one of the predictions was that the web was officially released and it has been realized. Another prediction is: 2021 will be the year of Flutter's great leap forward. When you summarize at the end of this year, let us verify whether this prediction is fulfilled .

Flutter 2.0 will be released in the next few days. More detailed content updates will be released, so stay tuned.

Let's take a look at the major updates of Flutter 2.0, the original link: https://developers.googleblog.com/2021/03/announcing-flutter-2.html

Our next generation Flutter built for the web, mobile and desktop

Today, we announced Flutter 2 : A major upgrade to Flutter that enables developers to create beautiful, fast, and portable applications for any platform. With Flutter 2, you can use the same code base to publish native applications to five operating systems: iOS, Android, Windows, macOS, and Linux. And web experience for browsers such as Chrome, Firefox, Safari or Edge. Flutter can even be embedded in cars, TVs, and smart home appliances to provide the most universal and portable experience for the world of environmental computing.

Our goal is to fundamentally change how developers think about building applications, not from the platform you want to target, but from the experience you want to create. Flutter allows you to create a beautiful experience by hand while branding and design are at the forefront . Flutter is fast and can compile source code into machine code, but thanks to our support for stateful hot reinstallation, you can still increase productivity , allowing you to make changes while the application is running and see the results immediately. Flutter is open, and thousands of contributors have added the core framework and expanded it through the package ecosystem.

In the Flutter 2 released today , we have extended Flutter from a mobile framework to a portable framework, freeing up your application so that it can run on a variety of different platforms with little change. There are already more than 150,000 Flutter apps in the Play Store alone , and each app can be upgraded for free with Flutter 2, because they can now be extended to target desktops and the Web without rewriting.

Customers from all over the world are using Flutter, including popular applications such as WeChat , Grab , Yandex Go , Nubank , Sonos , Fastic , Betterment and realtor.com . At Google, we rely on Flutter, and more than a thousand engineers at Google are using Dart and Flutter to build applications. In fact, many of these products have already been shipped, including Stadia, Google One and Google Nest Hub.

A few months ago, Google Pay switched to Flutter for its flagship mobile app , and they have made significant improvements in productivity and quality. By unifying the code base, the team eliminated functional differences between platforms and eliminated more than one million lines of code. Google Pay also reported that its engineers are much more efficient, technical debt is greatly reduced, and a unified release process (such as security reviews and trials across iOS and Android) has been achieved.

Flutter on the web

Perhaps the biggest announcement in Flutter 2 is the production quality support for the Web.

The early foundation of the Web was document-centric . However, the Web platform has evolved to include richer platform APIs that support highly complex applications with hardware-accelerated 2D and 3D graphics and flexible layout and drawing APIs. Flutter of Web-based support these innovations, in order to provide application-centric framework , the framework to fully utilize all the benefits of modern Web has to offer.

This initial release specifically focuses on three application scenarios:

  • Progressive Web Application (PWA) , which combines the access range of the Web with the functions of desktop applications.
  • Single-page application (SPA) , once loaded and data transmission between Internet services.
  • Bring existing Flutter mobile apps to the web , thereby enabling shared code for both experiences.

In the past few months, while preparing for the stable release of web support, we have made a lot of progress in performance optimization, adding a new rendering engine built by WebAssembly driven by CanvasKit . Flutter Plasma is a demo built by community member Felix Blaschke , demonstrating the ease of using Dart and Flutter to build complex web graphics experiences that can also be run locally on desktop or mobile devices.

We have been extending Flutter to provide the best web platform. In recent months, we have added text auto-fill function, control of URL and routing in the address bar, and PWA list. And because desktop browsers are as important as mobile browsers, we added interactive scroll bars and keyboard shortcuts, increased the default content density in desktop mode, and added screen readers to Windows, macOS and Chrome OS Support on accessibility.

Some examples of web applications built with Flutter have been provided. Among educators, iRobot is famous for its popular Root educational robot . Flutter's production support for the web allows iRobot to take advantage of its existing educational programming environment and move it to the web, thereby extending its usability to devices where Chromebooks and other browsers are the best choice. iRobot's blog post details the progress so far and why Flutter was chosen.

Another example is Rive, which provides designers with a powerful tool that can be used to create custom animations that can be published to any platform. Their updated web application is now available in Beta, is completely built by Flutter, and is a love letter to all the services that Flutter can provide in this environment.

You can find more information about Flutter in a dedicated blog post on our Medium publication .

Flutter 2 on desktops, foldable devices, and embedded devices

In addition to traditional mobile devices and the Web, Flutter is increasingly expanding to other device types. In today's keynote speech, we focused on three partnerships, which prove the portability of Flutter.

First of all, Canonical worked with us to bring Flutter to the desktop, and engineers contributed code to support development and deployment on Linux. At today's event, the Ubuntu team showed an early demo of the new installer rewritten by Flutter. For Canonical, it is crucial that they can provide a rock-solid and beautiful experience on a variety of hardware configurations. Looking to the future, Flutter is the default choice for future desktop and mobile applications created by Canonical .

Second, Microsoft is continuing to expand support for Flutter. In addition to the ongoing cooperation to provide high-quality Windows support in Flutter, today Microsoft will also release support for the Flutter engine to support emerging foldable Android devices. These devices introduce new design patterns, and their applications can expand content or take advantage of dual-screen features to provide a parallel experience. In a blog post from the Surface engineering team , they showed off their work and invited others to join them to jointly complete a high-quality implementation for Surface Duo and other devices.

image

Finally, Toyota Motor , the world's best-selling car manufacturer, announced its plan to bring the best digital experience to the vehicle by building an infotainment system powered by Flutter. The use of Flutter marks a big departure from the way in-vehicle software was developed in the past. Toyota chose Flutter because of its high performance and consistency of experience, rapid iteration and ergonomics of the developers, and the touch mechanism of the smartphone layer. By using Flutter's embedder API, Toyota can tailor Flutter to the unique needs of in-vehicle systems.

We are very happy to continue working with Toyota and other companies to apply Flutter to cars, TVs and other embedded devices, and we hope to share more examples in the coming months.

The evolving Flutter ecosystem

Now, there are more than 15,000 Flutter and Dart packages: from companies such as Amazon , Microsoft , Adobe , Alibaba , eBay and Square ; to important packages such as Lottie , Sentry and SVG , and Flutter Favorite packages such as sign_in_with_apple , google_fonts , Geolocator and sqflite .

Today, we announced the launch of the beta version of Google Mobile Ads Flutter , which is a new SDK that can be used with AdMob and AdManager to provide multiple ad formats, including banner ads, interstitial ads, native ads, and rewarded video ads. We have been trialing the SDK with several major customers, such as SuaMúsica (the largest independent artist music platform in Latin America), and now we are ready to open up the Google Mobile Ads Flutter SDK for wider adoption.

We will also announce updates to some of the core Firebase services of the Flutter plugin : authentication, Cloud Firestore, Cloud Functions, Cloud Messaging, Cloud Storage and Crashlytics, including support for reliable null security and a comprehensive check of the Cloud Messaging package .

Dart: The secret seasoning behind Flutter

As we have already pointed out, Flutter 2 can be ported to many different platforms and form factors. The easy transition to web, desktop, and embedded support is largely due to Dart , which is a Google programming language optimized for multi-platform development.

Dart combines a unique set of features to build applications:

  • Unexpected portability , its compiler can generate high-performance Intel and ARM machine code for mobile and desktop computers, and provide strictly optimized JavaScript output for the network. The same Flutter framework source code can be compiled to all these targets.
  • Iterative development of stateful hot reload on desktop and mobile devices , as well as the language structure designed for modern UI programming asynchronous and concurrent mode.
  • Google-level performance on all these platforms and reliable null security guarantee null constraints during runtime and development.

No other language can combine all these features. Maybe this is why Dart is one of the fastest growing languages ​​on GitHub .

Dart 2.12 is now released, our largest release since version 2.0, and it supports null security . Reliable null security has the potential to eliminate the terrible null reference exception, thereby providing a guarantee during development and runtime, that is, if the developer explicitly chooses, the type can only contain null values. Most importantly, this feature is not a major change: you can gradually add it to the code at your own pace, and you can use the migration tool to help you when you are ready.

Today's update also includes a stable implementation of FFI , allowing you to write high-performance code that can interoperate with C-based APIs. New integrated developer and analyzer tools written in Flutter ; as well as many performance and size improvements, these improvements can further upgrade the code without recompiling. For more information, check out the dedicated Dart 2.12 announcement blog post .

Flutter 2: Now released

Regarding Flutter 2, what to say is far beyond what we can cover in this article. In fact, the original list of merged merge requests is a 200-page document! Please visit the independent technical blog on Flutter 2 for information on many new features and performance improvements, which we think will satisfy existing Flutter developers and download it now.

We also have a major new sample that showcases everything just mentioned, which was built in collaboration with gskinner , an award-winning design team based in Edmonton, Canada . Flutter Folio is a scrapbook application designed for all your devices. The small screen experience is designed for capturing content; the large screen supports editing with desktop and tablet-specific idioms; the web experience is tailored for sharing. All these tailor-made experiences share the same code base, which is open source and available for you to read.

If you haven't tried Flutter, we think you will find it a major upgrade to your app development experience. In Flutter, we provide an open source toolkit for building beautiful and fast applications for mobile, desktop, web and embedded devices through a single code base that can meet Google’s demanding needs , Can also meet the needs of our customers.

Flutter is free and open source. We are very happy to see what you built with Flutter 2!

If you want to learn more about Android-related knowledge, you can click into my [ GitHub project: https://github.com/733gh/GH-Android-Review-master ] to check it out for yourself , and there are many records in it Android knowledge points. Finally, please give me your support! ! !

Guess you like

Origin blog.csdn.net/u012165769/article/details/114397980