What’s New In Flutter 3.19

What’s New In Flutter 3.19

Dhaval Baldha

16 Apr 2024

12 MINUTES READ

Introduction

Today we present you with a new Flutter release, Flutter 3.19. This release brings a new Dart SDK for Gemini, a widget enabling developers to add fine-grained control to widget animations, a rendering boost with updates to Impeller, tooling to help implement deep links, Windows Arm64 support and so much more! The Flutter community continues to impress, merging 1429 pull requests by 168 community members, with 43 community members committing their first Flutter pull requests! Keep reading to learn about all the new additions and improvements the Flutter community has contributed to this latest release!

What’s new in Flutter 3.19

1. Gemini AI flutter plugin

The Google AI Dart SDK has been released to beta. This enables you to build generative AI features into your Dart or Flutter app, powered by Gemini, Google’s latest family of AI models. There is now a google_generative_ai package on pub. dev. Learn more about how to build with the Google AI Dart SDK in this blog post or jump straight into the Dart quickstart.

2. Scrolling improvements

In Flutter 3.19, the Flutter team made some key improvements to scrolling behavior and fixed several bugs. Previously, scrolling with two fingers would cause the content to scroll twice as fast, but now you can configure the default Scroll Behavior to ensure consistent scrolling speed regardless of the number of fingers used.

thanks to the MultiTouchDragStrategy.latestPointer option. they have also resolved crashes and unexpected behavior in SingleChildScrollView and ReorderableList. Additionally, two-dimensional scrolling now stops as expected when dragging or tapping during a scroll. Furthermore, the TableView widget in the two_dimensional_scrollables package has been updated for a more polished appearance, added support for merged cells, and adopted new features from the 2D foundation introduced since the last stable release of 3.16.

We also completed bug fixes for SingleChildScrollView and ReorderableList, resolving several reported crashes and unexpected behavior. In two-dimensional scrolling, we resolved an issue so now, if you drag or tap while a scroll is underway in either direction, the scrolling activity stops as expected. The TableView widget in the two_dimensional_scrollables package has also been updated since the last release, providing more polish, adding support for merged cells, and adopting more of the new features of the 2D foundation after the last stable release of 3.16.

3. AnimationStyle widget

Flutter 3.19 introduces a new AnimationStyle widget that lets developers customize animation behavior in widgets like MaterialApp, ExpansionTile, and PopupMenuButton. By overriding default animation curves and durations, this widget offers greater control over the visual effects. By using the AnimationStyle widget, developers can specify a custom animation curve and duration for a popup menu. Furthermore, setting AnimationStyle.noAnimation disables animation altogether.

Here’s an example where the popup menu’s animation curve and transition duration are overridden:


    popUpAnimationStyle: AnimationStyle(
        Curve: Easing.emphasizedAccelerate,
        duration: Durations.medium4,
    ),
    

To disable animation entirely, you can use:


    return MaterialApp(
        themeAnimationStyle: AnimationStyle.noAnimation,
    )
     

4. Adaptive switch

In Flutter 3.19, the component adjusts its appearance to match the native look of macOS and iOS, while on other platforms, it follows the Material Design style. Importantly, it doesn’t rely on the Cupertino library, ensuring that its usage remains consistent across all platforms with the same API

See the adaptive switch pull request and the live example on the Switch. adaptive constructor API page.

5. Improves accessibility and text field functionality

With Flutter 3.19, all parts of your app that are accessible are identified by an accessibility identifier in SemanticsProperties. In Android, this name appears in a resource-id, whereas in iOS, it’s used similarly.

Additionally, support has been added for a MaterialStatesController in TextField and TextFormField, which allows developers to listen for changes in the state of these input fields. Lastly, there was a bug where the undo/redo history could disappear when using a Japanese keyboard, but now you can edit the text before it’s added to the undo history stack, fixing the issue.

6. Impeller progress

Earlier, Flutter update 3.16 introduced an impeller for powering Vulkan-enabled Android devices. The latest Flutter version 3.19 tends to resolve various pending issues with the Impeller. The performance enhancements introduced to the Impeller rendering engine can power the Flutter mobile app with smooth visuals and high-speed rendering.

Flutter developers are encouraged to update to the latest stable version and report any issues they encounter when using Impeller. This feedback is crucial for making Impeller the default renderer on Android later this year. Given the diverse Android hardware ecosystem, detailed feedback about specific devices and Android versions is especially valuable. Additionally, Impeller’s Vulkan backend offers more debugging options in debug builds, but these can impact performance. Therefore, feedback on performance should come from profile or release builds, including timelines from DevTools and a comparison with the Skia backend on the same device. As always, we appreciate feedback that includes a small, reproducible test case to demonstrate the issue.

Android OpenGL preview

In the 3.16 stable release, we invited users to try out Impeller on Vulkan-enabled Android devices, covering 77% of Android devices in the field. Over the past few months, we have brought Impeller’s OpenGL backend up to feature parity with the Vulkan backend, for example, by adding support for MSAA. This means that Flutter apps on nearly all Android devices are expected to render correctly, except for a small number of remaining features that are coming soon, such as custom shaders and full support for external textures.

We request that Flutter developers upgrade to the latest stable version, and file issues about any shortcomings observed when Impeller is enabled. Feedback at this stage is invaluable to ensuring that Impeller is successful on Android and that we can confidently make it the default renderer in a release later this year. The Android hardware ecosystem is much more diverse than the iOS ecosystem. Therefore, the most helpful feedback about Impeller should include detailed information about the specific device and Android version where issues occurred.

Further, as a reminder, Impeller’s Vulkan backend enables additional debugging capabilities in debug builds beyond what is used with Skia, and these capabilities have additional runtime overhead. Therefore, it’s important to give feedback about Impeller’s performance from a profile or release build. The bug report should include timelines from DevTools and a comparison with the Skia backend on the same device. Finally, as always, we are very grateful for feedback that includes a small reproducible test case that demonstrates the issue.

Roadmap

After rendering fidelity, our main focus in Impeller’s Android preview period is performance. We continue to make incremental gains, however a couple of larger improvements are also in progress. We expect work to take advantage of Vulkan subpasses to greatly improve the performance of advanced blend modes. Further, we also expect that a change in rendering strategy away from always tessellating every path on the CPU towards a Stencil-then-cover approach will greatly reduce Impeller’s CPU utilization on both Android and iOS. Finally, we expect that a new implementation of Gaussian blurring will match the throughput of the Skia implementation, and improve idiomatic use of blurring on iOS.

7. Deep linking web validator

Unlike previous versions of the UI Kit, the update team has introduced a powerful deep-linking web validator tool. It helps the developers’ team replace dead links and validate the content, which allows the code development team to build the app hassle-free.

It’s been reported that developers have had difficulty setting up deep links (the links that take users from a website to a specific page in the mobile app). To help, the Flutter team has developed a validation tool. The tool checks if your deep links are set up correctly and guides you through the process of fixing any issues. It’s our pleasure to announce that the Flutter deep link validator is now available in an early version!

In this version, the validator checks your Android setup for web links, specifically the assetlinks.json file. You can use DevTools to access the Deep Links tab and import your Flutter project with deep links, and the validator will let you know if your web file is configured correctly. More information on how to use the tool can be found in the deep link validation tool testing instructions.

Deep linking Web Validator

We hope this tool makes setting up deep links easier for you. In the future, the Flutter team plans to add support for checking web links on iOS, as well as checking app links on both iOS and Android.

8. Windows arm64 support

With official support for Arm64 on Windows, Flutter applications will run more efficiently and perform better on Arm64 devices. Although in its early stages, this development signifies a significant step forward for Flutter developers looking to optimize their apps for Windows devices. As a result of this support, Flutter apps could run faster and more smoothly on Arm64 devices, improving their user experience. Eventually, Flutter developers will be able to create apps for Windows devices that take full advantage of Arm64 architecture.

9. Performance optimizations

The Flutter team has made A few improvements to the Impeller graphics engine. By supporting specialization constants in shaders, they were able to reduce the Flutter engine’s code size by 350KB. They also made optimizations to backdrop filters and blurs, improving performance by 20–70% in certain scenarios. One contributor noticed a mistake in how Impeller was handling textures, leading to unnecessary performance overhead. By fixing this, they were able to significantly improve graphics rendering times on devices like the Pixel 7 Pro. Overall, these changes make Flutter apps run smoother and faster on supported devices.

Specialization constants

The team added support for specialization constants to Impeller. Taking advantage of this feature in Impeller’s shaders reduced the uncompressed binary size of the Flutter engine by nearly 350KB.

Backdrop filter speedups

There is much more work to do, however, this release includes a couple of nice performance improvements for backdrop filters and blurs on Impeller. In particular, open-source contributor @knopp noticed that Impeller was mistakenly requesting the capability to read from the onscreen texture. Removing this capability improved scenes that include multiple backdrop filters anywhere from 20–70% in our benchmarks, depending on complexity.

Further, Impeller no longer unconditionally stores the stencil buffer on every backdrop filter. Instead, any clip-affecting operations are recorded and replayed into a new stencil buffer when restoring the save layer for the backdrop filter.

Backdrop filter speedups

With this change, our benchmark of animated advanced blend modes on a Pixel 7 Pro running Impeller with the Vulkan backend improved average GPU frame times from 55ms to 16ms, and improved 90%-ile raster thread CPU times from around 110ms down to 22ms.

10. Dev-tools updates

Some highlights for DevTools with this release are:

  • Added a new feature and screen in DevTools to validate deep links setup on Android.
  • Added an option in the Enhance Tracing menu for tracking platform channel activity. This is useful for apps with plugins.
    tracking platform channel
  • The Performance and CPU profiler screens are now made available when there is no connected app. Performance data or CPU profiles that were previously saved from DevTools can be reloaded for viewing from these screens.
  • The Flutter Sidebar in VS Code now can enable new platforms if not enabled for the current project, and the DevTools menu in the sidebar now has the option to open DevTools in an external browser window.

To learn more, check out the release notes for DevTools, 2.29.0, 2.30.0, and 2.31.0.

11. Flutter iOS native fonts

Flutter text now looks a little more compact and a little more native on iOS. According to the Apple design guidelines, smaller fonts on iOS should be more spread out to be easier to read on mobile, while larger fonts should be more compact and not take up as much space. Before, we were incorrectly using the smaller, more spaced-out font in all cases. Now, by default, Flutter will use the compact font for larger text.

Flutter iOS Native Fonts

So All of these upgrades together make Flutter a more efficient and high-performing framework. This ensures that developers using Flutter can create applications that work well and provide a great user experience, also I gathered this information by researching multiple websites. If you come across any incorrect or misinterpreted information, kindly bring it to my attention by commenting below.

Conclusion

As we highlighted the remarkable number of contributors at the start of this announcement, we did so with purpose. The evolution of Flutter into the powerful and efficient toolkit it has become is a direct testament to the dedication and hard work of our incredible community. A heartfelt thank you to every one of you.

To dive into the specifics of what has been achieved with this release, we invite you to view the release notes and change log for a comprehensive list of additions in Flutter 3.19.

Flutter 3.19, alongside Dart 3.3, is now available on the stable channel. Embarking on this latest journey with Flutter is as straightforward as running Flutter upgrade.

FAQ

With Google's most recent AI models, developers may incorporate generative AI capabilities into their Dart or Flutter apps with the Gemini AI Flutter Plugin, a recent beta release from Google.

Flutter 3.19 brought improvements to the way that scrolling works, such as the option to set the default scroll behavior to scroll at a constant speed no matter how many fingers are used. ReorderableList and SingleChildScrollView crashes and unexpected behavior were also fixed.

With Flutter 3.19, developers have more control over visual effects by overriding default animation curves and durations in widgets such as MaterialApp, ExpansionTile, and PopupMenuButton. This is made possible via the AnimationStyle widget.

In Flutter 3.19, the Adaptive Switch modifies its design to conform to the Material Design style on other platforms while maintaining the native look of macOS and iOS. It does not require the Cupertino library and may be used on any platform that has the same API.

Flutter 3.19 improved accessibility by giving each accessible section of the app an accessibility identifier. Additionally, it supported a MaterialStatesController in TextField and TextFormField and resolved a problem with undoing/redoing history while using a Japanese keyboard.

The advancement of the impeller in Flutter 3.19 fixes a number of outstanding rendering engine problems, improving performance for fluid graphics and rapid rendering. Developer feedback is essential to the future development of Impeller as the default renderer for Android, with an emphasis on compatibility and performance enhancements for a wide range of Android devices.

Dhaval Baldha
Dhaval Baldha

Co-founder

Dhaval is a visionary leader driving technological innovation and excellence. With a keen strategic mindset and deep industry expertise, he propels the company towards new heights. His leadership and passion for technology make him a cornerstone of Techvoot Solutions' success.

Linkedin
Hire Skilled Developer

*Please fill all the required fields

Get our Newsletter

Customized solutions for your projects

*Please fill all the required fields