Google I/O 2022 : Flutter Updates

What’s New In Flutter 2022

In this article, we will talk about what is new in Flutter which has been announced during the Google IO 22. Flutter 3.0 is live and supports 6 distinct platforms out of the box! We are really excited to share what’s new in Flutter. 

Flutter 3.0

So it has been announced that, with Flutter 3, you can build a single codebase for 6 different platforms out of the box: Android, iOS, Web, Windows, and now Linux and macOS. Under the hood, the Flutter engine compiles your code to each platform target, ARM or Intel machines for desktop and mobile, or highly optimized JavaScripts for web. For more detail on the release notes, you can look at their developer page: Flutter 3.0.0 release notes | Flutter

Flutter on Apple Silicon

The latest version of Dart and Flutter offers tools that run natively on ARM64 processors. You do not need to rely on Rosetta when analyzing or compiling code for the Flutter app. Right now, there are two versions of Flutter SDK for macOS, ARM for those who are using silicon processors and Intel for older versions of MacBook processors. If you have already installed the SDK, just run Flutter upgrade and the system will automatically download the right binaries for your platform. 

Flutter on Linux

Flutter 3 also supports building Linux apps. And this work comes through a joint collaboration with Canonical, the organization behind Ubuntu. Who has a suite of packages that add tailored UI and integration with the Linux system services such as: dbus, gsettings, network manager, Bluetooth, and desktop notifications. As well as the Ubuntu look and feel; a theme called Yaru. If you are curious about Flutter and Ubuntu you can visit this page: Flutter and Ubuntu so far | Ubuntu 

What’s new on Flutter mobile

Introduced foldable support

As you may know, not long ago, there were a few folding devices released. Flutter 3 now supports foldable mobile devices. Thanks partially to contributions from Microsoft, you can now take advantage of new features and widgets, allowing you to create dynamic and delightful experiences on foldable devices. For more information about the foldable support, you can visit this link: Announcing Flutter support for foldable devices – Surface Duo Blog (microsoft.com)

Material 3 widgets

With this new Material 3 widget, you can take advantage of the newest and most beautiful UI toolkit in your Flutter app. If you are curious about what Material 3 looks like you can find it here: Material Components widgets | Flutter, Take your Flutter app from boring to beautiful (google.com)

Re-architected the platform view support on Android

The latest version of Flutter now asynchronously composes Android views commonly referred to as platform views, meaning, there isn’t a need to wait for the native android view to render. Flutter uses OpenGL texture to place the view on the screen, therefore, making the platform view rendering smoother. More detail about platform view and how to set it up in your app is found here: Hosting native Android and iOS views in your Flutter app with Platform Views | Flutter

What’s new on Flutter web

Web App lifecycle

With this new API, you can easily control your web app in certain lifecycles when needed such as: showing a splash screen while loading your app, loading prerequisites data in a startup while showing a landing page in the first startup and many more. You can visit this link if you want to implement this API in your app: Customizing web app initialization | Flutter

Image Decoding

In the latest version of Flutter web, the image decoding API is updated and optimized by asynchronously decoding the image outside the UI thread using the built-in browser codecs. Thus improving the decoding speed by around two times without blocking the UI thread so the user will not see all the jank when loading the image.

New Flutter Dev Tools

Flutter DevTools also has some new features in this release. With these, you can see the build, paint, and layout performance information in a timeline that was captured by DevTools. 

  • Track widget builds -> add an event to the timeline for every widget build
  • Track layouts -> add an event to the timeline for every RenderObject layout
  • Track paint ->  add an event to the timeline for every RenderObject painted

For more detail about the Flutter Dev Tools you can visit this site: DevTools | Flutter

What’s new on Dart 2.17

We spent some time talking about Flutter 3 on desktop, web, and mobile. But this is also a great release for Dart with some new language improvements for building with Flutter or creating a command-line tool.

Enhanced Enumeration

When defining an enum type, you can now give it additional: fields, methods, getters, and even operators, you can also implement interfaces just like a regular class. 

Named Args Anywhere

Dart removes the restrictions in named arguments. Named arguments can make APIs easier to understand the point of use by making it clear what each argument represents. In older versions, any named arguments are required to be at the end of the arguments. That restriction is kind of frustrating when you have a positional argument like a large collection literal, or a function expression that looks best at the end. And now Dart lets you order your positional and named arguments in whatever way reads best.

Super Constructors

Dart already lets you use this before constructing a parameter to implicitly initialize a field on the class. We also let you use super to implicitly pass that parameter to the super classes constructor. As you can see, we can reduce many lines of code by using this. If you want to know the full release notes for Dart 2.17 you can visit this link: Dart 2.17: Productivity and integration | by Michael Thomsen | Dart | May, 2022 | Medium, What’s new | Dart

Firebase Support in Flutter

Some of you may have noticed some preparations taking place over the last couple of months. For example, the code base for the Flutter fire plugins was recently moved from Firebase and extended into the main Firebase account on GitHub. The docs, which had previously been hosted at firebase.flutter.dev, were migrated directly into the Firebase developer site alongside: Android, iOS, web, and the other supported platforms. Flutter is now presented as a choice alongside the other platforms. Here you can find how to set up your Flutter app in Firebase: Add Firebase to your Flutter app

Flutter Casual Games Toolkit

For those who are interested in gaming development, there is really good news. Flutter casual games toolkit was released by Google in IO 22. This toolkit contains a resources starter kit, like games sample, tutorial and codelab, along with community space and credits for purchasing Google Developer Services. If you want to know more about this you can visit the official page here: Games (flutter.dev)

So, I guess that’s about it. All the exciting updates about Flutter in Google IO 22. 

References

Introducing Flutter 3. The culmination of our journey to… | by Tim Sneath | Flutter | May, 2022 | Medium
What’s new in Flutter – YouTube
What’s new in Flutter 3. Deep dive into our latest release… | by Kevin Jamaul Chisholm | Flutter | May, 2022 | Medium

2
Share

More Articles

let's talk illustration

Loving what you're seeing so far?

It doesn’t have to be a project. Questions or love letters are fine. Drop us a line

Let's talk arrow right