Flutter Update

10 min

10 min

Sahaj Rana

Published on Feb 16, 2024

Discover What's New in the Latest Flutter 3.19 Update: Gemini API, Impeller Updates & Windows Arm64.

Introduction

Welcome to the latest Flutter release, version 3.19! This update marks another significant step forward in the evolution of Flutter, offering developers a plethora of exciting features and enhancements to elevate their app development experience.

Overview of Flutter 3.19: Flutter 3.19 stands as a testament to the continuous evolution of the Flutter framework. With a focus on empowering developers and enhancing user experiences, this release introduces a multitude of features and improvements that cater to the diverse needs of app creators.

Significance of Key Updates: The heartbeat of Flutter 3.19 resonates through key updates, each playing a pivotal role in shaping the landscape of app development:

  1. Gemini API: Unveiling a new era of control and precision, the introduction of the Gemini API offers developers a powerful tool for fine-grained control over widget animations. This not only opens new avenues for creativity but also elevates the quality of user interactions within Flutter applications.

  2. Impeller Updates: The rendering engine, Impeller, receives a significant boost, promising enhanced performance and a smoother development experience. This update underscores Flutter's commitment to optimizing the core components that drive app responsiveness and visual appeal.

  3. Windows Arm64 Support: With an eye on inclusivity, Flutter 3.19 extends its support to Windows Arm64 devices. This move broadens the reach of Flutter applications, ensuring they seamlessly integrate with a wider range of platforms and devices.

Flutter 3.19 introduces a host of new capabilities designed to empower developers and enhance the performance of their applications. One of the standout features of this release is the introduction of the Dart SDK for Gemini, a groundbreaking advancement that opens up new possibilities for app development. With Gemini, developers gain access to a powerful set of tools and libraries that enable them to build more sophisticated and responsive applications than ever before.

AI Integration with Gemini API

In Flutter 3.19, the integration of Google AI with the Gemini API marks a significant milestone in the evolution of app development. With the beta release of the Google AI Dart SDK, developers now have the power to infuse their Dart and Flutter applications with generative AI features, leveraging the cutting-edge capabilities of Google's latest AI models.

We’re thrilled to announce the Google AI Dart SDK launch for the Gemini API. The new pub.dev package, google_generative_aiand supporting resources enable you to build your generative AI-based features into Dart and Flutter apps through an idiomatic Dart integration with the Gemini API. It opens the door to a vast range of possibilities for building intelligent, performant Android, iOS, web, macOS, Windows, and Linux applications from a single code base.

With the Google AI Dart SDK, you can:

  • Easily integrate generative AI features: Add advanced text generation, summarization, chat, and more to your Dart or Flutter apps with minimal setup.

  • Tap into Google’s most capable and general model yet: The Gemini model draws on Google’s extensive research and development in machine learning, giving you access to generative AI capabilities that will continue to improve.

  • Accelerate your AI-powered app development: Focus on your app logic and user experience, while the SDK handles the intricacies of interacting with AI models.

  • Build cross-platform AI-powered apps: Easily create generative AI features across desktop, web, and mobile applications using Flutter.

  • Use the Gemini API in more than 180+ countries and territories: Check the available regions for the most current list of countries and regions where the Gemini API and Google AI Studio (described further below) are available.

What can you build? Check out the Dart quickstart for a detailed step-by-step guide on how to get set up.

The endless possibilities are endless with the Google AI Dart SDK and the Gemini API. Dive into the world of AI-powered app development and unlock new opportunities to create intelligent and engaging experiences for users worldwide.

Framework Enhancements

Flutter 3.19 introduces a series of enhancements to the framework, elevating the development experience and improving the functionality of various widgets. Let's delve into the details:

Scrolling Improvements:

  • Flutter's scrolling behavior has undergone significant refinement. Previously, scrolling twice as fast with two fingers has been addressed by configuring the default ScrollBehavior with MultiTouchDragStrategy.latestPointer. This ensures a consistent scrolling experience regardless of the number of fingers used. For more information on this change, see the migration guide.

  • Bug fixes for SingleChildScrollView and ReorderableList have been implemented, resolving reported crashes and unexpected behavior. Two-dimensional scrolling has also been fine-tuned to stop scroll activity promptly when dragging or tapping during a scroll in either direction.

  • The TableView widget in the two_dimensional_scrollables package has received updates, offering more polish, support for merged cells, and integration of new features from the 2D foundation introduced in Flutter 3.16.

AnimationStyle:

  • A new AnimationStyle widget has been introduced, courtesy of Flutter community member @TahaTesser. This widget allows developers to override default animation behavior in various widgets such as MaterialApp, ExpansionTile, and PopupMenuButton. Developers now have greater control over animation curves and durations.

SegmentedButton.styleFrom Usage:

  • Flutter community member @AcarFurkan has contributed a styleFrom static utility method, aligning with other button types. This method streamlines the creation of a SegmentedButton's ButtonStyle, facilitating sharing across segmented buttons or configuring the app's SegmentedButtonTheme.

Adaptive Switch Implementation:

  • The Adaptive Switch, with a native feel on macOS and iOS and a Material Design look elsewhere, has been introduced. Not relying on the Cupertino library, this adaptive component maintains a consistent API across all platforms.

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

SemanticsProperties for Accessibility Identifier:

  • A new accessibility identifier in SemanticsProperties provides a crucial identifier for the semantic node in the native accessibility hierarchy. Thanks to community member @bartekpacia, this change spans both the engine and framework, enhancing accessibility on Android and iOS.

Increased Access to Text Widget State:

  • Support for a MaterialStatesController in TextField and TextFormField has been added. This enhancement allows developers to listen to MaterialState changes, offering more dynamic control over text widget states.

UndoHistory Stack Improvements:

  • Addressing an issue where the undo/redo history could disappear on Japanese keyboards, modifications can now be made to an entry before it's pushed to the UndoHistory stack. This ensures a more reliable and customizable undo/redo experience for users.

These framework enhancements in Flutter 3.19 underscore Flutter's commitment to providing developers with powerful tools and capabilities, empowering them to create high-quality, feature-rich applications with ease.

Engine Upgrades

Flutter 3.19 ushers in substantial upgrades to the engine, particularly with notable progress made on Impeller, the rendering engine behind Flutter. Let's delve into the key aspects of these engine enhancements:

Impeller Progress in Android OpenGL

In the previous 3.16 stable release, Flutter extended an invitation to users to explore Impeller on Vulkan-enabled Android devices, covering a significant 77% of Android devices in use. Over subsequent months, Impeller's OpenGL backend has undergone significant advancements, achieving feature parity with its Vulkan counterpart. Notably, support for MSAA has been added, ensuring Flutter apps render correctly on nearly all Android devices. While some features, such as custom shaders and complete support for external textures, are on the horizon, developers are encouraged to upgrade to the latest stable version and provide feedback on any observed shortcomings. This valuable feedback is crucial for making Impeller the default renderer in an upcoming release.

Roadmap for Future Developments

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.

API Improvements

Glyph Information

This release introduces two new methods for the dart:ui Paragraph object: getClosestGlyphInfoForOffset and getGlyphInfoAt, each returning an object of the new type GlyphInfo. Developers can explore the documentation on the new GlyphInfo type for detailed information.

GPU Tracing

Under Impeller on Metal (iOS, macOS, Simulator), and on Vulkan-enabled Android devices, the Flutter engine now provides GPU times for each frame in the timeline, available in debug and profile builds. DevTools users can inspect GPU frame timing under the "GPUTracer" heading, offering enhanced visibility into performance metrics.

With these engine upgrades, Flutter 3.19 ensures that developers can leverage advanced rendering capabilities, improved performance, and enriched API functionalities for creating even more compelling and efficient Flutter applications.

Please note that since non-Vulkan Android devices might misreport their support for querying GPU timing, Impeller’s GPU tracing can only be enabled with a flag set in the AndroidManifest.xml file on these devices.

<meta-data
  android:name="io.flutter.embedding.android.EnableOpenGLGPUTracing"
  android:value="true" />

Performance Optimizations

Flutter 3.19 introduces significant upgrades to the engine, enhancing performance and introducing new features to elevate the app development experience.

Specialization Constants for Improved Performance

The Impeller engine now supports specialization constants, a feature that substantially reduces the uncompressed binary size of the Flutter engine, enhancing overall performance by nearly 350KB.

Backdrop Filter Speedups

This release brings notable performance improvements to backdrop filters and blurs on Impeller. By removing the capability to read from the onscreen texture, scenes with multiple backdrop filters witness performance boosts ranging from 20–70%, depending on complexity. Moreover, Impeller no longer unconditionally stores the stencil buffer on every backdrop filter, resulting in significant improvements in GPU frame times and raster thread CPU times.

Android Improvements

Deeplinking Web Validator

  • A new Flutter deeplink validator is introduced, simplifying the implementation of deep linking. Developers can now validate the configuration of assetlinks.json files on Android, ensuring correct setup and providing implementation guidance.


Support for Share.invoke

  • The default Share button, previously missing on Android, is now added in this release, ensuring all default context menu buttons are universally available on each platform. You can follow that ongoing work in PR #107578.

Native Assets Feature Update

  • Flutter 3.19 facilitates FFI calls through Native assets on Android, enhancing interoperability with functions from other languages within Flutter code.

Texture Layer in Hybrid Composition Mode

  • Google Maps and the text input magnifier now function in Texture Layer Hybrid Composition (TLHC) mode, promising better performance for apps utilizing these features.

Custom System-Wide Text Selection Toolbar Buttons

  • Android apps can now incorporate custom text selection menu items in all text selection menus, providing more flexibility in Flutter's TextField selection menu.

iOS Enhancements

Flutter iOS Native Fonts Integration

  • Flutter text on iOS now adheres more closely to Apple's design guidelines, with smaller fonts being more spaced out for improved readability and larger fonts appearing more compact to save space.

With these engine upgrades, Flutter 3.19 continues to refine the development environment, offering improved performance, streamlined functionality and enhanced visual aesthetics across both Android and iOS platforms. Developers can explore these enhancements to create even more sophisticated and responsive applications.

DevTools Updates

Discover the latest enhancements in DevTools with Flutter 3.19, designed to elevate your development experience and streamline your debugging and profiling workflows. Here's an overview of the key improvements:

Deeplinks Validation on Android:

  • DevTools now features a new tool and screen dedicated to validating deeplinks setup on Android. This ensures a smooth and error-free deeplink integration process, enhancing your app's navigation capabilities.

Enhanced Tracing for Platform Channel Activity:

  • Explore the new option in the Enhance Tracing menu, specifically designed for tracking platform channel activity. This addition proves invaluable for apps utilizing plugins, providing insights into the communication between Flutter and native code.

Performance and CPU Profiler Screens Availability:

  • Even when there's no connected app, the Performance and CPU profiler screens are now accessible. Previously saved performance data or CPU profiles can be reloaded and viewed directly from these screens, offering flexibility in analyzing app performance.

Flutter Sidebar Improvements in VS Code:

  • The Flutter Sidebar in Visual Studio Code (VS Code) has been enhanced. It now allows you to enable new platforms if they are not enabled for the current project. Additionally, the DevTools menu in the sidebar offers a convenient option to open DevTools in an external browser window, providing a seamless and customizable development environment.

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

Desktop Development

Windows Arm64 support

Flutter on Windows is now embracing initial support for the Arm64 architecture, thanks to the commendable efforts of community member @pbo-linaro. This initial support paves the way for more efficient and performant Flutter applications that run natively on Windows Arm64 devices. Although still in development, with progress trackable on GitHub issue #62597, this move signifies a promising enhancement for Flutter developers aiming to optimize their apps for a broader range of Windows devices.

With Windows Arm64 support, Flutter developers gain access to a broader audience and can optimize their applications for a wider range of Windows devices. This move not only enhances the versatility of Flutter but also opens up exciting opportunities for innovation and growth in the desktop development sphere.

Ecosystem Progress

Required reason privacy manifest

Flutter now includes a privacy manifest on iOS to meet upcoming Apple requirements.

Third-party SDKs enhance app functionality but may impact user privacy. Developers must be vigilant about data collection practices. Apple introduced privacy manifests and SDK signatures at WWDC23 to increase transparency. Privacy manifests detail third-party code privacy practices, simplifying Privacy Nutrition Labels creation. SDK signatures ensure SDK integrity during version updates, enhancing software supply chain security. Starting in spring 2024, App Store submissions must include privacy manifests and signatures for listed SDKs. This requirement applies to new apps and updates containing listed SDKs. Compliance ensures transparency and integrity in app development and supports user privacy.

Progress of the Flutter and Dart package ecosystem

The Flutter and Dart package ecosystem remains a key enabler for developers to build beautiful, performant apps for any screen from a single codebase. The ecosystem grew 26% in 2023 from 38,000 packages in January to 48,000 at the end of December.

Pub.dev now has more than 700,000 monthly active users as of January 2024. The Flutter team remains keen and committed to supporting this growth into the future, and enabling developers to build with and contribute to Flutter and Dart. In this update, we’ll take a look at the newest Flutter Favorites, and results of the Package Ecosystem Virtual Summit and share some notable updates and things to know.

In case you missed it, check out the blog post from January on the progress of the Flutter and Dart package ecosystem.

Deprecations and Breaking Changes

In the relentless pursuit of progress, Flutter 3.19 introduces some crucial deprecations and breaking changes aimed at steering development toward more secure, streamlined, and feature-rich environments. Here's what you need to know:

Dropping Support for Windows 7 and 8:

  • As part of Flutter's evolution, we're aligning with the latest technologies by discontinuing support for Windows 7 and 8 with the Dart 3.3 and Flutter 3.19 releases. This strategic shift, in harmony with Microsoft's approach, allows us to focus on enhancing Flutter for modern operating systems. We understand the adjustments this may require from our developers and are committed to guiding you through this transition. This move lays the foundation for a more secure, efficient, and feature-rich development environment on supported versions of Windows. We appreciate your understanding and adaptability as we collectively innovate within the Flutter ecosystem.

Impeller Dithering Flag Deprecation:

  • In line with the 3.16 stable release, the global flag Paint.enableDithering has been deprecated. For a comprehensive understanding of this breaking change, please refer to the detailed announcement on our website.

iOS 11 Deprecation:

  • Flutter bids farewell to support iOS 11 due to a runtime crash triggered by certain networking APIs. Consequently, apps built against Flutter 3.16.6 and later won't be compatible with devices running iOS 11. We appreciate your flexibility as we make these adjustments to ensure a more stable and reliable development environment.

Auto Render Mode Deprecation Details:

  • This release introduces breaking changes, including the deprecation of APIs that expired post the v3.16 release. Consult the deprecation guide for this release to identify all affected APIs, complete with additional context and migration guidance. Flutter fix, coupled with quick fixes in the IDE, supports many of these deprecations. Bulk fixes can be efficiently implemented using the dart fix command line tool. As always, our heartfelt thanks to the community for contributing tests, and aiding us in identifying and addressing these breaking changes. Additionally, note that this release marks the incorporation of the flutter_driver package into the deprecation policy, joining the ranks of already supported packages like flutter and flutter_test.

Embrace these changes as stepping stones towards a more robust and forward-looking Flutter ecosystem. Your collaboration and understanding play a vital role in ensuring a smooth transition to the future of app development with Flutter.

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.