Google Unveiled Flutter 3 – Here Are All the New Features
22 Jun 2022 | Mobile App Development
Google’s introduction of Flutter 3 expanded the platform support, provided more functionality to improve developer experiences, and ultimately extended the startups’ market reach for their apps.
During the previous Flutter versions, Flutter supported Android, iOS, web, and recently, Windows. These were substantial upgrades, but the new version, Flutter 3, added Linux and macOS. This platform support was the major update, along with many other impressive features.
So, do you want to know the updates that came with Flutter 3? Let’s find out now!
The new features of the Flutter 3
There are a lot of changes that came with Flutter that we will discuss, so let’s get down to business and into the updates.
Platform support
The wider a cross-platform framework spans multiple devices, the more it becomes powerful. And now, Flutter offers stable support for macOS and Linux, alongside Android, iOS, web, and Windows (supported on Feb 2022). This feature allows you to create apps that work on all six platforms from a single codebase.
Flutter supports Apple Silicon and Linux, and thus your apps can now run on the six major platforms with natively compiled apps with the new Flutter 3.
The stable support for macOS includes support for both the Intel and Apple Silicon to allow you to run native apps on both the architectures. This support is possible because of the support for Universal Binary.
Universal Binary is Apple’s format for executable files, used with apps running on both Intel computers with 32/64-bit architectures and computers with a 64-bit extension of ARM to enable the transition to Apple Signal.
Tooling updates
Multilingual support
Flutter 3 made it possible to globalize your apps with the updated Flutter localizations package. Now, it is possible to increase your user base around the globe for users who prefer different languages for your Flutter applications.
US English is still Flutter’s default, but adding more language support is now easier with the localizations widget. You can also add new languages if the list of supported languages does not include what you prefer. Follow this link to learn how you add support to your new language in Flutter.
Furthermore, the new release fully supports the international text Input Method Editors (IMEs), including Chinese, Japanese, and Korean, on all three desktop platforms.
Support for accessibility services
Accessibility services, like the accessible navigation, screen-readers, and inverted colours, are now fully supported with the new release for desktop platforms.
Lint package updates
Dart powers Flutter. And this update also came with several new features for Dart, which increases code readability while reducing the boilerplate sourcing time for higher developer productivity.
Dart linter is a powerful feature that helps developers identify potential code issues by analyzing source codes through the available linter rules. It checks the typing errors, code styles, and code formats, saving you thousands of hours you could spend trying to identify them manually.
Dart and Flutter lints version 2 has been released with Flutter 3. Therefore, you will now use these versions automatically when you create a new app using Flutter create.
However, you’ll continue using the previous lint versions for your existing apps unless you migrate to the new lint updates. To follow Flutter’s latest best practices, you should migrate to v2 through flutter pub upgrade –major-versions flutter_lints.
Impeller engine
In 2021, the Flutter team resolved several jank issues on iOS, yet there was still a need to rethink these solutions. With this new Flutter release, it’s now possible to preview an experimental rendering backend on iOS — thanks to the Impeller engine. That shows satisfactory work from the team writing the graphics backend.
Impeller precompiles a smaller or simple set of shaders during engine build time to prevent compilation while the app is running, thus reducing jank significantly and increasing the speed by over 20 times.
While Impeller is not yet production-ready, this is a significant upgrade that will save a lot of headaches for developers, especially on iOS and other platforms.
Material Design 3 Support
With the new Flutter 3 release, coupled with support for Material You, Flutter now supports opt-ins to Material Design 3. If you want to try the new features in Material Design 3 in Flutter, you can play along with this codelab here: Take Your Flutter App From Boring To Beautiful.
Web updates
ImageDecoder API Support
With the Flutter 3 release, image decoding is now two times faster. This speed increase is because Flutter web has been upgraded to detect the ImageDecoder API automatically in the browser and use it when supported. Thankfully, almost all the Chromium-based browsers support the API.
The benefit of using the ImageDecoder API is that it decodes your images asynchronously with the help of a built-in image code in the browser. Therefore, it removes all the image janks during the process with perfect timing off the main thread without intercepting the operations. Thus, the whole process of image decoding becomes faster.
Flutter web app initialization
Another change on Flutter web updates includes the lifecycle API. This new update gives developers the flexibility and control for the bootstrap process of Flutter apps. The process will now be easier to monitor and analyse a Flutter app performance on the host HTML page. You can now use an interactive landing page, a splash screen, and a loading indicator before your Flutter app completes the loading process.
Performance Updates
Engine’s raster and UI thread prioritization
Flutter engine raster and UI threads for Android and iOS are now given a higher priority. With this update, the average frame processing time reduces, thus increasing your app’s performance.
A perfect example of prioritization during multitasking is the prioritized schedules of the UI threads and the Dart VM garbage collection threads. When they are running simultaneously, the UI threads are assigned more priority, so they will be scheduled to run at a higher level.
Opacity animations
Flutter 3 comes with small-scale performance improvements for opacity animation. These improvements have been proven to offer benefits as the rasterization time improved on a benchmark’s measure of approximate comparisons. An example of this improvement includes the omitted saveLayer method when opacity invokes it to reduce rasterization time and improve the app’s performance.
Raster cache
Flutter 3 came with a new way to determine if an image should be cached or rendered. This mechanism estimates the cost of an image’s draw operations to determine if it is good for caching. Previously, the admission policy used just the number of the draw operations in the image to do the same. Therefore, there will be minimal memory waste on images that could render faster.
Frame scheduling
There’s also a bug fix on the dropped frames on iOS. There had been a lot of issues reported for this bug. This update fixed the frame scheduling bug, so the animations dropping will no longer be an issue. Also, this update became a relief for the users who depend on Flutter to build their apps.
Breaking changes
Here are some of the changes that may cause other Flutter features to fail or not work as expected.
Sunsetting support for 32-bit iOS/iOS 9/iOS 10
Flutter 3 came as the last stable version supporting 32-bit iOS devices and iOS versions 9 and 10. The devices impacted after this release include iPhone 4S, iPhone 5, iPhone 5C, and the 2nd, 3rd, and 4th generation iPad devices.
Upgrade of the Flutter/Firebase integration
Flutter integration with Firebase is now fully supported as the core part of Firebase offer. The source code and documentation will move to the main Firebase repo and site, thus you can be sure that this integration will continue to receive considerate attention.
Conclusion
This update to Flutter 3 came with significant features that make the framework much better, faster, and more powerful. These features include platform support for Linux and Mac, new engine introductions like Impeller, and continued optimizations like UI threads optimizations.
Furthermore, Flutter 3 improved the developer experiences with features like updated lints, Material Design 3 support, and expanded platform support.
While many features are aimed toward improving the engine’s speed and developer experiences, others have improved the app’s performance, which improved the user experiences significantly.
As more and more features are updated, Flutter will become an indispensable tool for cross-platform development. So, if you consider developing your app soon, consider choosing Flutter not only to save costs and time but also for the improved app’s performance.