Flutter Update

14 min

14 min

Sahaj Rana

Published on May 14, 2024

Flutter 3.22 Update: What's New in Framework, Material, iOS, Android, Windows & More?

Introducing Flutter 3.22

Flutter has emerged as a game-changer in the world of app development, offering developers a powerful and versatile framework for building beautiful and high-performance applications across multiple platforms. With its rich set of widgets, robust development tools, and excellent performance, Flutter has quickly gained popularity among developers worldwide.

Introducing Flutter 3.22:

In our latest exploration, we shine a spotlight on Flutter 3.22 – the newest iteration of this groundbreaking framework. With each update, Flutter continues to refine its features, enhance its performance, and expand its capabilities. Version 3.22 is no exception, bringing a host of improvements and innovations to the table.

Big Wins:

  • No Firebase Issues: This is a significant relief, as Firebase integration is crucial for many Flutter apps. The absence of issues ensures the continued functionality and reliability of Firebase services in your applications.

  • Few Material and Framework Breaking Changes: The minimal impact of breaking changes to Material and the Flutter framework simplifies the update process, reducing the need for extensive refactoring and allowing for a smoother transition.

TODOs:

  • Regenerate Build Files: Updating build files like index.html and Gradle ensures compatibility with the latest version of Flutter and its dependencies, maintaining the integrity of your project's build process.

  • Replace Deprecated Libraries: Addressing deprecated libraries is essential for maintaining the long-term viability and performance of your applications. By replacing them with up-to-date alternatives, you can future-proof your codebase and take advantage of the latest features and optimizations.

Overall, it sounds like the Flutter team has delivered a successful update with version 3.22, providing improvements and stability while minimizing disruptions to your development workflow. Keep up the excellent work, and here's to continued success with Flutter!

Framework

The Flutter 3.22 update brings a slew of improvements and fixes to the framework, addressing various issues and enhancing the overall development experience. Here are some notable changes:

  • Disable Test Shuffling: Test shuffling in widget_tester_leaks_test.dart has been disabled to ensure more consistent test runs.

  • Fix Spell Check: Spell check no longer throws errors when text contains regex reserved characters, improving text handling.

  • Remove Order Dependency: Conditions dependent on order have been removed, enhancing predictability and stability.

  • Upgrade Leak Tracker: The leak tracking mechanism has been upgraded for more efficient memory management and debugging.

  • Introduce New Form Validation Method: A new method for form validation has been introduced, offering more flexibility and control.

  • Dynamic View Sizing: The dynamic view sizing feature has been reapplied for improved layout flexibility.

  • Improved Testing for Leak Tracking: Testing for leak tracking has been improved for better accuracy and reliability.

  • ProcessText QueryTextActions Handling: Null cases in ProcessText queryTextActions are now handled correctly, preventing errors.

  • Text Style Debug Label: Debug labels are no longer ignored in TextStyle copyWith, ensuring better debugging support.

  • NestedScrollView Enhancement: Issues with NestedScrollView's outer scrollable jumping due to precision errors have been addressed.

  • Additional Fixes and Enhancements: Several other fixes and enhancements have been made to improve performance, stability, and usability.

Overall, these updates contribute to a smoother and more robust Flutter framework, empowering developers to create high-quality apps with ease.

Material Widgets

Flutter 3.22 brings significant updates and fixes to the Material design system, enhancing the user experience and providing developers with more tools and flexibility to create stunning applications. Let's delve into some of the highlighted and important bug fixes and features introduced in this release:

1. Chip Enhancements:

  • Improved chip shape customization.

  • Updates to chip tests for Material 3.

  • Addressed issues with chip icons and label colors.

2. SelectableRegion and CircularProgressIndicator Improvements:

  • Custom system-wide text selection toolbar buttons for SelectableRegion on Android.

  • Resolved issues with indeterminate CircularProgressIndicator on Darwin.

3. SearchBar and SearchAnchor Updates:

  • Added an 'enable' property to disable the SearchBar.

  • Fixed search view clear button visibility.

  • Improved behavior of SearchAnchor to avoid unnecessary suggestion builder calls.

4. TextField and TextFormField Enhancements:

  • TextField can now scroll when disabled.

  • Fixed TextField helper top padding on Material 3.

  • Corrected input decorator suffix and prefix widget tappability.

5. Miscellaneous Fixes and Improvements:

  • Various documentation updates and typo fixes.

  • Refactored if chains into switch statements for cleaner code.

  • Added AnimationStyle support to showBottomSheet and showModalBottomSheet.

  • Addressed issues with Scrollbar thickness and behavior on hover.

These updates and fixes demonstrate the Flutter team's dedication to refining the Material design experience and ensuring a smoother development process for Flutter app creators. Stay tuned for more insights into Flutter 3.22's advancements!

In Flutter 3.22, significant updates have been made to iOS, Android, and Windows platforms:

iOS:

  • Enhanced native assets handling and debugging capabilities.

  • Added support for wireless debugging on iOS 12 or earlier.

  • Improved CI logs upload and warning for unpaired iOS devices.

Android:

  • hello_world app migrated to Gradle Kotlin DSL for improved build scripts.

Windows:

  • Add check for Bank of Brazil security module to Windows Flutter Doctor validator.

These updates streamline development workflows and enhance app reliability across platforms.

DevTools

Flutter 3.22 introduces significant tooling enhancements to streamline development workflows:

  • Native Assets Support for Android Add2app: Facilitates smoother integration of native assets into Android applications.

  • Gradle Kotlin DSL Support: Enables more concise and expressive build configurations with Kotlin DSL.

  • Improved Shader Target Selection: Produces optimized shaders for different rendering environments on Android.

  • Asset Bundle Optimization: Streamlines asset bundle management for improved performance.

  • Enhanced Gradle Version Handling: Ensures compatibility and stability with different Gradle releases.

Engine and Impeller

In this section, we're diving into the latest enhancements and fixes introduced in the Flutter Engine update. Let's explore some of the key improvements across different aspects of the engine.

Impeller Enhancements:

  • New Blur Effect: A notable addition is the new blur effect, which now offers improved downscaling and supports mipmaps for backdrop filters, ensuring smoother visual effects.

  • Shader Bundle Improvements: Significant improvements have been made to shader bundles, including better support for uniform structs, member offset reflection, and Vulkan runtime effects/fragment program API, enhancing rendering capabilities.

  • Rendering Pipeline Optimization: The rendering pipeline has undergone optimization, with enhancements like descriptor pool incremental allocation and direct writing to block allocated device buffers, resulting in more efficient rendering processes.

  • Memory Management Optimization: Memory management has been optimized with reduced shared_ptr copies and better buffer usage in compute operations, leading to improved performance and resource utilization.

General Engine Updates:

  • Linux Compatibility: Linux compatibility has been improved with thread name truncation, ensuring smoother operation on Linux systems.

  • Validation Error Handling: Better validation error handling has been implemented, providing developers with more accurate error reporting and easier debugging.

  • Performance Optimization: Various performance optimizations have been applied, resulting in better frame rates and reduced jank, enhancing the overall user experience.

These updates demonstrate the Flutter team's commitment to enhancing the engine's performance, stability, and feature set, ultimately empowering developers to build even better Flutter applications.

Platform-Specific Enhancements

Android, iOS, and Web Updates

In this section, we'll delve into the noteworthy bug fixes and features introduced in the Flutter 3.22 update across the Android, iOS, and web platforms.

Android Updates:

  • RenderTarget Resizing: Improved efficiency by resizing the RenderTarget before creating and passing its Surface to the VirtualDisplay.

  • PlatformViewRenderTarget Simplification: Streamlined the PlatformViewRenderTarget interface for enhanced usability.

  • IDE-Friendly Shell: Enhanced the shell/platform/android for improved compatibility with IDEs and added documentation.

  • Best Practices Compliance: Implemented various best practices in FlutterRenderer for optimized performance.

  • SurfaceTextureSurfaceProducer: Added SurfaceTextureSurfaceProducer for better handling of surface textures.

  • TextInputPlugin Fixes: Resolved issues with TextInputPlugin, including resetting IME state and fixing NullPointerException.

  • OpenGL Texture Optimization: Improved OpenGL texture handling for better rendering performance.

  • Android Studio Integration: Enhanced Android Studio integration for smoother development workflows.

  • NDK Updates: Updated NDK to version 26 for compatibility and performance enhancements.

iOS Updates:

  • iOS 12 Compatibility Removal: Removed iOS 12 availability checks for streamlined code and improved compatibility.

  • Memory Sanitizer Fix: Addressed memory sanitizer violations when encoding indirect strings on macOS.

  • Text Composition Fix: Fixed issues with text composing on macOS for improved text input handling.

  • Accessibility Enhancement: Added support for accessibility back gesture to pop routes from view controller.

Web Updates:

  • Dart2wasm Bootstrapping: Refactored flutter.js for dart2wasm bootstrapping and preloading of CanvasKit/Skwasm.

  • Blob URL Policy Update: Left blob URLs untouched in text-to-speech policy for improved web functionality.

  • Accessibility Improvements: Enhanced accessibility support with focus state detection and improved text crawlability.

  • Font Fallback Customization: Added ability to customize font fallback download URL for greater flexibility.

These updates underscore Flutter's commitment to delivering a seamless development experience across different platforms, ensuring stability, performance, and accessibility for all developers and users. Stay tuned for more insights into Flutter 3.22 updates across other platforms!

Miscellaneous Changes

In addition to the highlighted bug fixes and features, several other changes were made in this release:

  • Consistent Stack Size for Flutter Threads: Flutter threads now enforce a consistent stack size, ensuring more predictable behavior across different environments.

  • Memory Leak Fixes in Embedder Unit Tests: Several memory leaks in embedder unit tests that send key events have been addressed, improving test reliability.

  • Clang-Tidy Command Building Improvement: Building clang-tidy commands now filters out unnecessary commands, enhancing build efficiency.

  • Buildroot Update for iOS 12: The buildroot has been rolled to pick up iOS 12, ensuring compatibility with the latest iOS version.

  • Migration to Flutter Mirrors for Google-Owned Repositories: Google-owned GitHub repositories have been migrated to use Flutter mirrors, streamlining development workflows.

  • Refactoring and Reverts: Various refactoring efforts have been made, including RBE support refactors and subsequent reverts for optimization.

  • OSV-Scanner Integration: Integration with OSV-Scanner has been implemented, enhancing security scanning capabilities.

  • Fuchsia Updates: Several updates and improvements have been made for Fuchsia, including changes to test execution and dependency management.

  • Linux and macOS Specific Changes: Multiple changes have been made to improve compatibility and performance on Linux and macOS platforms.

  • Dart SDK Updates: The Dart SDK has been updated to the latest version, bringing performance improvements and bug fixes.

  • Impeller and Vulkan: Updates and improvements have been made to Impeller and Vulkan support, enhancing rendering capabilities.

  • Documentation and Tooling: Various improvements to documentation and development tooling have been made to streamline workflows and improve developer experience.

  • CI/CD Enhancements: Continuous integration and delivery pipelines have been enhanced for improved reliability and efficiency.

Conclusion

It's great to hear that the Flutter 3.22 update brought some big wins and relatively smooth sailing for your projects.

In conclusion, the Flutter 3.22 update introduces a host of exciting new features and improvements across various platforms, including Framework, Material, iOS, Android, Windows, and more.

From enhanced accessibility features to improved performance and stability, developers can expect a smoother and more efficient development experience. With continued support for platform-specific optimizations and integration with cloud-based resources, Flutter remains a powerful tool for building high-quality cross-platform applications. Whether you're a seasoned developer or just getting started with Flutter, these updates offer valuable enhancements to help you create exceptional user experiences across multiple devices and platforms.