In the early morning of March 4th, Flutter 2 was officially released: The ability of Flutter developers to create beautiful, fast, and portable applications for any platform has been improved. With Flutter 2, you can use the same code base to build native applications for five operating systems: iOS, Android, Windows, macOS and Linux; And building web experiences for browsers like Chrome, Firefox, Safari and Edge. Flutter can even be embedded into cars, TVS and smart home appliances, providing the most pervasive and portable experience for environmental computing.

Our goal is to fundamentally change the way developers think about building apps and put experience before platform. Flutter allows you to create an elegant application experience, expressing your brand and design style freely. Flutter compiles your source code to machine code and runs it quickly. It also brings you the productivity of interpreting your environment with stateful hot overloading, allowing you to make changes as your application runs and see the results immediately. Flutter is also open source, with thousands of contributors contributing to the core framework and building an ecosystem of massive packages around it.

With the release of Flutter 2, we have expanded Flutter from a mobile framework to a portable framework that allows your application to run on multiple platforms virtually unchanged. There are over 150,000 Flutter apps available on the Google Play store alone, and now applications can be deployed to desktop devices and web platforms without having to be rewritten. Each application can be said to receive a “free upgrade” through Flutter 2.

Flutter is used by users around the world, including popular apps such as WeChat, Grab, Yandex Go, Nubank, Sonos, Fastic, Betterment and Realtor.com. Flutter is also a valued tool at Google. We have more than 1,000 engineers building applications using Dart and Flutter. Many products have been announced, including Stadia, Google One, and Google Nest Hub.

A few months ago, Google Pay switched to Flutter to build its flagship mobile app, making significant improvements in productivity and quality. By unifying the code base, the team eliminated functional differences between platforms and streamlined more than 500,000 lines of code. Google Pay also says its engineers have become much more productive, its technical debt has been significantly reduced, and it has unified its release process for security reviews and experiments on iOS and Android.

Flutter web support

Perhaps the most significant development that Flutter 2 has brought is a stable version on the Web platform.

The early foundations of the Web were document-centric. However, as the Web platform has evolved, it has become increasingly rich in platform apis, enabling highly complex applications, hardware-accelerated 2D and 3D graphics, and flexible layout and painting apis. Flutter Web support builds on these innovations and provides an application-centric framework that captures all the benefits of the modern Web.

The initial release with this release focuses specifically on three application scenarios:

  • Progressive Web Apps (PWA) combine the high coverage of the Web with the power of desktop applications.
  • Single Page apps (SPA) can be loaded once to communicate with Internet services.
  • Bring the existing Flutter mobile application to the Web, enabling both experiences to share code.

There has also been a lot of progress in performance optimization over the past few months in preparing for the release of stable Web support, with the addition of a new CanvasKit-powered rendering engine built by WebAssembly. Flutter Plasma is a demo built by community member Felix Blaschke to show how easy it is to build complex Web graphical experiences using Dart and Flutter that can also run natively on a desktop or mobile device.

We continue to expand Flutter to provide the best features of the Web platform. In recent months, we’ve added auto-fill text, address bar URL and routing controls, and PWA listings. Since desktop browsers are as important as mobile browsers, we’ve added interactive scrollbars and keyboard shortcuts, improved default content density in desktop mode, and added screen reader accessibility support for Windows, macOS, and Chrome OS.

There are already a number of examples of Web applications built using Flutter. Among educators, iRobot is best known for its popular Root education robot. Flutter’s support for a production environment on the Web platform enables iRobot to bring its existing educational programming environment to the Web, thus covering Chromebooks and other browser-centric devices. IRobot’s blog post details why the Flutter was chosen and how it is used.

Another example is Rive, which has a powerful tool for designers to create custom animations and publish them to any platform. The new version of the Web app, built entirely with Flutter and now in Beta, is one of the best Flutter experiences on the web platform.

You can learn more about Flutter Web from the Flutter Web release.

Flutter 2 on desktop, foldable and embedded devices

Flutter is increasingly covering other types of devices besides traditional mobile devices and the Web. Three partners were highlighted during the Flutter Engage keynote to demonstrate Flutter portability.

Our first partner, Canonical, joined forces with us to bring Flutter to the desktop. Canonical engineers contributed code that enabled Flutter developers to develop and deploy Flutter on Linux. At the event, the Ubuntu team showed off an early demo of a new installation that uses Flutter rewrite. For Canonical, it is important to provide a rock-solid and fantastic experience across multiple hardware configurations. In the future, Flutter will be Canonical’s first choice for creating desktop and mobile applications.

The second partner, Microsoft, is continuing to expand its support for Flutter. In addition to continuing to work with us to provide high-quality Windows support for Flutter, Microsoft has also released its contribution to the Flutter engine: support for emerging foldable Android devices. These devices have led to new design patterns, where apps can expand content or take advantage of the dual-screen feature to provide a side-by-side window experience. In a blog post, the Surface engineering team laid out their work and invited everyone to join them in creating a high-quality solution for the Surface Duo and other devices.

A third partner, Toyota, one of the world’s best-selling automakers, announced plans to build an infotainment system powered by Flutter to create the best digital automotive experience. The use of Flutter marks a big step forward in the way in-car software is developed. Toyota chose Flutter because of its high performance and consistency of the experience, its ability to iterate quickly and extremely high developer productivity, as well as its smartphone-level touch experience mechanism. By using the Flutter embedder API, Toyota was able to customize the Flutter to the unique needs of the on-board system.

We are proud to continue to work closely with partners like Toyota to bring Flutter to cars, TVS and other embedded devices, and we will bring you more examples of this in the coming months.

Sustainable development of the Flutter ecosystem

Currently, Flutter and Dart have over 15,000 packages: Including enterprise packages such as Amazon, Microsoft, Adobe, Alibaba, eBay and Square, key packages such as Lottie, Sentry and SVG, Flutter Favorite package including sign_IN_with_apple, Google_fonts, Geolocator and SQflite.

We are also bringing the Google Mobile Ads Beta to Flutter. This new SDK provides multiple AD formats, including banner, interfold, native and incentivized video Ads, via AdMob and AdManager. We have already invited some major customers (such as Sua Musica, the largest music platform for independent artists in Latin America) to experiment with the SDK and now plan to open Up Google Mobile Ads for more Flutter developers to adopt.

We have also updated the Flutter plugin for several core Firebase services: Cloud Functions, Cloud Messaging, Cloud Storage, and Crashlytics Includes support for sound air security and a complete overhaul of the Cloud Messaging Package.

Dart: The secret behind Flutter

As mentioned earlier, the Flutter 2 can be ported to many different platforms and devices. The easy transition to support for Web, desktop, and embedded devices is due in large part to Dart, Google’s multi-platform optimized programming language.

Dart provides a unique set of capabilities for building applications:

  • With no unexpected portability, the compiler generates high-performance Intel and ARM machine code for mobile and desktop devices and outputs tightly optimized JavaScript for the Web. The same Flutter framework source code compiles to all these target platforms.
  • Iterative development of stateful hot overloading on desktop and mobile devices, and language constructs designed for asynchronous, concurrent patterns of modern interface programming.
  • Consistent Google-level performance across the platform and robust space safety ensures runtime and development-time space constraints.

No other language offers all of these capabilities, which perhaps explains why Dart is one of the fastest growing languages on GitHub.

Dart 2.12, our concurrent release, is the most significant release update since 2.0 and supports robust air safety. Robust null-safety eliminates the headache of null-reference exceptions, and a type cannot contain nulls at development time and runtime unless the developer explicitly allows it. Most importantly, this feature is not breaking change: you can gradually add empty safety to the code at your own pace, and we have a migration tool ready for you to use when you’re ready.

Other updates to this release include: a stable version of FFI, which allows you to write high-performance code that interoperates with C-based apis; New integration developer and performance profiler tools written with Flutter; As well as many performance improvements and sizing optimizations, the code can be significantly improved simply by recompiling. For more information, see the Dart 2.12 release article.

Experience Flutter 2 immediately

When introducing Flutter 2, this article is inevitably full of information due to space limitations. In fact, the consolidated PR (Pull Request) list is 200 pages long! Read the Flutter 2 technology blog post for more new features and performance improvements that we think will please Flutter developers. Download Flutter 2 now and start experimenting with it.

We also have a new demo app for you, Flutter Folio, created in collaboration with our award-winning design team Gskinner in Edmonton, Canada, that shows everything we just mentioned. Flutter Folio is a scrapbooking application that runs on all your devices. There’s an emphasis on presentation when playing on a small screen; When played on the big screen, content can be edited in desktop and tablet idioms; The Web experience emphasizes sharing. These customized experiences share the same open source library and are available for you to browse freely.

If you haven’t tried Flutter yet, we believe it will greatly improve your app development experience. Flutter, an open source toolkit, allows you to build beautiful, fast applications for mobile, desktop, Web, and embedded devices from a single code base, even when facing the demanding demands of Google and its users.

Flutter is free and open source. What wonderful applications will you build with Flutter 2? We’ll see!