What’s New In Flutter 3.22

image2

What’s New In Flutter 3.22

Just when the news started spreading about Flutter’s extermination, Google I/O flashed the release of its brand-new update– The Futter 3.22, shutting the mouth of the people rolling out misinformation about the framework. 

In this new version of the Flutter framework, you will see the stable channel of WebAssebly, a delightful Vulkan backend feature for Android impeller, more magnificent graphics, and a major boost in performance, Flutter 3.22 version unfolds many exciting amendments to 2024 that is turning the future of Flutter bright. 

Let’s go through the top updates from the Flutter 3.22 version! 

Top Updates From The Flutter 3.22 Release

1. WebAssembly

Wasm is now available on the stable channel and offers notable performance gains with the release of Flutter 3.22. With Chrome running on an M1 MacBook for our internal benchmarks, the Wonderous app’s frame rendering time decreased by a factor of two on average and three in the worst situations.

These improvements are critical for apps that require a steady frame rate, such as those with animations and sophisticated transitions. Wasm facilitates smoother animations and transitions by lowering performance bottlenecks. Check out our Flutter Wasm guide and our Dart Wasm documentation to get started integrating Wasm with your Flutter web apps. Check out the Flutter at Google I/O blog article for the whole announcement.

2. Flutter Engine

The rendering engine that drives your Flutter apps, Impeller, has seen major improvements as of Flutter 3.22. Highlights include ongoing refinements for blur effects and complicated path rendering, a new experimental API for testing with Impeller, and the completion of the Vulkan backend on Android for better performance and smoother visuals. We’re dedicated to improving Impeller’s quality and performance following our roadmap, which includes finishing the iOS to Impeller migration and extending Android support.

Impeller

  • Android Vulkan backend feature completed

Impeller’s Vulkan backend for Android is a feature complete with this version. The team has been working extremely hard over the last several months to implement all blur styles, support for custom fragment shaders using the FragmentProgram API, fast advanced blends, and PlatformView compatibility (although with a little API migration).

  • Android sneak peek

After releasing updates to the OpenGL backend of Impeller in the 3.19 stable release, we extended an invitation to users to test Impeller on Android devices with and without Vulkan support. We have determined to concentrate our efforts on getting the Vulkan backend production-ready first, having over the previous several months assessed the OpenGL backend’s performance and estimated the amount of work still to be done on it.

Shader compilation jank is resolved by the impeller. Furthermore, it beats the traditional renderer in our benchmarks for average, 90th, and 99th percentile frame times. As a result, we think the Vulkan backend’s Android performance is adequate. 

When available, a program that chooses to use Impeller will use the Vulkan backend, as of this release (3.22). This will be set as the default in a later edition. If an app chooses to use Impeller and is running on a device that isn’t compatible with Vulkan, Flutter will automatically revert to utilizing OpenGL ES with Skia. You don’t need to do anything. This fallback will also use the OpenGL ES Impeller backend when we think it’s ready for production use.

While the 3.22 stable cycle of the Impeller preview is still available for Android, we ask Flutter developers to update to the most recent stable version and report any problems regarding any difficulties that arise when using Impeller. 

To guarantee that Impeller succeeds on Android and that we can with confidence make it the default renderer in a release later this year, feedback at this point is crucial. There is a wide range of hardware available for Android. Because of this, the most beneficial comments on Impeller should provide comprehensive details about the particular device and Android version that the problems were occurring.

  • Blur performance enhancements

Impeller has redesigned Blur for both iOS and Android. Specifically, the new method—which is comparable to Skia’s—cuts blurring’ CPU and GPU times in half in benchmarks.

The graph below displays GPU frame timings in milliseconds for an iPhone 11 device in a pathological test designed to emphasize blur performance. It also displays worst-case, 99%-ile, 90%-ile, and average frame rasterization durations. The cost of backdrop filter blurs on CPU and GPU has been almost reduced since Impeller’s blur was rewritten. 

As would be shown in usual apps, this improvement’s magnitude also applies to non-pathological circumstances.

image5

The Stencil-then-Cover method outlined in the OpenGL Redbook chapter “Drawing Filled, Concave Polygons Using the Stencil Buffer” is now the basis for Stencil-then-Cover Impeller on both iOS and Android platforms. In GitHub issue #123671, team members talked further about this strategy as it relates to Flutter.

With this method, the problem of the raster thread consuming too much CPU time computing tessellations for intricate paths—like SVGs and Lottie animations—is resolved. Following the modification, for frames with complicated routes, the total frame time (UI thread on the CPU + raster thread on the CPU + GPU work) is significantly reduced. Users will see that complicated routes, such as Lottie animations, render more smoothly and consume less CPU power and slightly higher GPU utilization. 

Even though these advancements are encouraging, more work has to be done. We are aware that polyline creation is still a significant aspect of CPU profiles, among other opportunities, and we want to look into moving this work to the GPU as well.

  • New API

Flutter test now takes the –enable-impeller flag, which runs Impeller on the Vulkan backend, even if it’s still experimental.

3. Framework

  • Attributes of a widget state

To make MaterialState available to Cupertino, the main Flutter framework, and package developers, it has been relocated outside of the Material library and renamed WidgetState. See the migration guide for further details on how to make the switch to the new WidgetState.

Also Read: Top 10 widgets in the Flutter Widget Catalog Every app developer should know

  • Adjustable view size

Improvements to dynamic view scaling help developers create responsive layouts that have improved user interface flexibility across a range of screen sizes.

  • Enhanced validation of forms

SharbelOkzan, a community member of Flutter, has contributed to Flutter 3.22 by providing more configurable form validation techniques that let developers design more robust user input processing, improving security and usability.

  • 2D API Covariants

For sophisticated animations and games, it is crucial to streamline development processes and improve performance by decreasing the requirement for type casts in 2D graphics APIs.

  • Bundling assets based on flavor

Developers may now set up particular components to only be packaged when creating for a certain flavor by utilizing the flavors functionality. See Conditionally bundling assets based on flavor for further details.

  • Converting assets using Dart packages

Now, users may build up Dart Flutter packages to change the assets of their apps as they are wrapped. See Transforming assets at build time for further details.

4. Android

  • Deep linking

Your Flutter app’s user experience may be greatly enhanced by deep links, which serve as convenient shortcuts that lead users to certain information inside the app, increase engagement, and increase revenue. Although App Links for Android and Universal Links for iOS are very safe and easy to use, they can be a little difficult to set up.

We included a deep link validator tool in DevTools to help verifying the web settings of Android apps in the most recent stable release of Flutter. We’ve included a new set of capabilities in this edition to assist with verifying settings in your Android manifest files.

  • Anticipatory reversal motion

With Flutter app development services, users may now preview the previous route or even the prior app when executing a back motion. This functionality is part of Android’s future predictive back initiative. On Android devices, this is still hidden behind a feature flag, but GitHub has instructions on how to give it a try.

image7

 

image4-min

  • Version requirements for Gradle, AGP, Java, and Kotlin are enforced by the Flutter tool

With this release, the Flutter tool establishes guidelines for the Gradle, Java, Kotlin, and Android Gradle Plugin (AGP) versions it supports. At first, the program just offers alerts.

The following version ranges are currently supported:

  • Gradle: 7.0.2 and higher are fully supported; if not, provide a warning.
  • AGP: 7.0.0 and higher are fully supported; if not, provide a warning.
  • Java: Up to now, Java 11 is fully supported; if not, alert users
  • Kotlin: 1.5.0 to the present is fully supported; if not, alert users

These warnings will become errors in the next major release, however you may override them using the parameter –android-skip-build-dependency-validation. More generally, before entirely discontinuing support (producing an error) for a particular version of these Dependencies, the tool issues a warning for at least one release.

  • Gradle Groovy DSL for use in Gradle build scripts for Android

Gradle Kotlin DSL is now supported in Flutter, offering an alternative to the conventional. With features like auto-completion, instant access to documentation, source navigation, and context-aware refactoring, this support makes code editing easier.

The GitHub user bartekpacia provided this early assistance. To take advantage of these advantages, developers may now opt to rewrite their Gradle build scripts in Kotlin; however, at this time, utilizing Flutter Create does not let developers pick Kotlin over Groovy.

  • Platform views enhancements

Attention to all creators of Flutter apps! We have some significant news if you’re using Flutter to create apps that depend on native Android components (such as maps, web views, or certain UI elements).

Android 14 has a problem that may prevent apps developed with previous Flutter versions from functioning correctly on devices running this latest Android version.

This problem is resolved in Flutter 3.22, which also enhances the functionality of these native Android app components. Thus, make sure to rebuild and publish your app with Flutter 3.22 to guarantee that it functions flawlessly on all Android devices.

Additionally, this update contains internal enhancements to improve platform perspectives on Android’s general dependability and performance.

  • KitKat support is ending

Lollipop (API 21) is currently the minimum Android version that Flutter supports. With the stable version of 3.22, Flutter will no longer function on Android KitKat (API 19)-powered smartphones. 

5. iOS

  • Performance of the platform view

We are aware that many Flutter developers have had issues with platform view performance on iOS. When employing platform views, this has been particularly apparent in scroll views.

Recent changes significantly enhance circumstances such as inserting several inline adverts within an article, directly addressing these problems. Here are a few significant enhancements to our benchmark:

  • GPU utilization has been cut by 50%, which should result in a smoother user experience and decreased power consumption.
  • Better frame rendering: There has been a 33% reduction in average frame render times, or 1.66 ms.
  • Reduced jank: The worst-case frame render durations were slashed by 21%, or 3.8 ms.

If you have previously had issues with performance while utilizing various platform views (such as advertisements, maps, etc.) within scrolling views, these adjustments may result in a scrolling experience that is more responsive and fluid. Kindly test it out and report back to us on your thoughts.

image8

6. Ecosystem

  • Preview release of Vertex AI for Firebase Dart SDK

The Dart SDK is included in the Vertex AI for Firebase offering, which is now available for public preview. With production, performance, and enterprise scalability in mind, this allows you to leverage the Gemini API to develop generative AI capabilities for your Dart or Flutter application. Firebase App Check, which is integrated with the SDK, secures your API requests and defends your backend infrastructure from dangerous attacks like phishing, billing fraud, and app impersonation.

image6

The Google AI Dart SDK is still accessible and should only be used for experimentation. Google AI offers pay-as-you-go pricing and free access (where accessible and within restrictions). Check out the migration instructions if you have been using the Google AI Dart SDK for prototyping and are prepared to switch to Vertex AI for Firebase.

  • DevTools Updates

DevTools, the collection of performance and debugging tools for Dart and Flutter, is still being refined. Performance gains, general refinement, and new features like sophisticated filtering, the ability to import and export memory snapshots, and the inclusion of CPU samples in the timeline are all included in this edition.

The devtools_extensions and devtools_app_shared packages, which assist DevTools extension writers, also included some noteworthy updates. We have included the ability to connect an extension to the new Dart Tooling Daemon (DTD). This enables DevTools extensions to communicate with the development project using a simple file system API and to access public methods registered by other DTD clients, like an IDE.

  • Flutter’s Google Mobile Ads SDK

We have some great news for those of you using ads to monetize your Flutter apps. Version 5.0.1 of Google Mobile Ads for Flutter is a significant upgrade that was just published!

  • Improved User Messaging Platform (UMP) SDK support: 

The most recent APIs from the iOS UMP SDK version 2.4.0 and Android UMP SDK version 2.2.0 are now supported by the upgrade. To comply with privacy standards and facilitate the process of obtaining user consent for tailored adverts, you must utilize the UMP SDK. Several new APIs are included in this edition to streamline the consent-gathering procedure.

  • Increased mediation partners: 

By providing connections with well-known ad partners like Unity, Meta, AppLovin, Iron Source. And Mintegral, Pangle, DT Exchange, InMobi, and Liftoff. Flutter has increased your opportunities for ad monetization. With more mediation choices and easier deployment, you can now optimize your app income.

Try out these new functionalities in your Flutter apps. And let us know about any more mediation partners you would want to have supported by Flutter. We value your opinions greatly and will keep improving the Google Mobile Ads SDK for Flutter.

7. Revolutionary Modifications and Revisions

  • V1 Android embedding removal

Version one of the Android embedding is now being deleted. Most applications won’t likely be impacted by this, since

  • For many years, version two has been the norm.
  • If the flag ignore-deprecation is not expressly overridden, the Flutter tool would already prevent the creation of version one applications.

This version fully disables Flutter tool support for v1 applications. Overriding is no longer possible.

Please take note, plugin authors: a migration document was created for you at https://docs.flutter.dev/release/breaking-changes/plugin-api-migration when the v1 android embedding was first deprecated. It was advised that plugin writers maintain support for apps employing the v1 embedding as part of this migration by including a method with the signature into their *Plugin.java files.

public static void registerWith(@NonNull io.flutter.plugin.common.PluginRegistry.Registrar registrar)

Plugins that have a method with this signature will no longer compile. When we completely remove the v1 Android embedding in the next version. (because it references a type from the v1 Android embedding).

Since this update has damaged apps that use the v1 embedding, it is presently useless. To prevent issues with next Flutter versions. We advise plugin developers to release new versions of their plugins as soon as possible. Removing the v1 code. See PR 6494, which eliminated the Flutter team’s plugins, as an illustration.

  • Removing deprecations in 3.22

Deprecated APIs that expired after the release of v3.19. is one of the breaking changes in this release. See the deprecation guide for this version for a list of all impacted APIs, further background, and migration advice. Numerous of these, including the IDE’s rapid fixes, are supported by Flutter Fix. Applying and evaluating bulk patches may be done with the Dart Fix command-line tool.

Final Thoughts

A slew of innovative features have been added to Flutter 3.22. With the goal of improving app speed and development experience. With technologies like the Google Mobile Ads SDK, Gradle Kotlin DSL support, and Vertex AI. Firebase Dart SDK developers can create creative and effective apps.

Moreover, better animations, an enhanced user experience, and higher development productivity are facilitated by the Impeller rendering engine. The Vulkan backend, and other improvements. With these improvements, Flutter keeps reaffirming its standing as the top framework for creating cross-platform applications.

 Examine these top 12 features and see directly how they transform user experience, performance, and app development.


0


Leave a Reply

Your email address will not be published. Required fields are marked *