Introduction
Flutter 3.24 has arrived, bringing a range of new features, improvements, and fixes. In this blog post, we’ll dive into the major updates and what they mean for developers.
Boosting Graphics Performance with Flutter’s GPU API
Flutter 3.24 introduces the Flutter GPU API, a groundbreaking feature that grants developers direct access to hardware-accelerated graphics. This API facilitates the development of sophisticated graphics and 3D scenes within Flutter applications, enhancing the visual performance and capabilities of your projects.
To start using the Flutter GPU API, switch to the main channel and add the flutter_gpu package to your project.
Read the detailed blog post on Flutter GPU API. It’s a great choice for games and complex graphics in your projects.
Introduction to Swift Package Manager:
Managing dependencies and packages in iOS and macOS apps can be challenging. Flutter 3.24 simplifies this with early support for Swift Package Manager (SwiftPM), which makes handling Swift code dependencies easier.
- Benefits of SwiftPM Integration:
SwiftPM support enables developers to seamlessly add and manage Swift packages in their Flutter projects.
- This integration streamlines dependency management, making it simpler to build and maintain iOS and macOS apps. Additionally, the update brings enhancements to the Cupertino widget library, now featuring 37 new widgets and improved auto-fill and accessibility.
For more details, please review the blog at this link.
Improved Enum Features for AnimationStatus
AnimationStatus is an enum that represents the status of an animation. In Flutter 3.24, several updates have been made to improve the handling of animation states:
Enum Values
The AnimationStatus enum now includes the following values:
- dismissed: The animation is not running and is at the beginning of its range.
- forward: The animation is currently running forward.
- reverse: The animation is currently running in reverse.
- completed: The animation has finished running and is at the end of its range.
New Updates
In Flutter 3.24, additional statuses have been introduced to provide finer control and better handling of animation states. These new statuses include:
- paused: The animation is currently paused. This status allows for more granular control over animations, enabling developers to pause and resume animations as needed.
Updates in SelectionArea
The SelectionArea widget in Flutter 3.24 introduces several significant improvements
Flutter’s SelectionArea now supports triple clicks with a mouse and double taps on touch devices. By default, the SelectionArea and SelectableRegion widgets use these gestures.
Enhanced Selection Features
- Triple-Click to Select Paragraph: The SelectionArea now supports triple-click to select an entire paragraph of text. This feature streamlines text selection for users who want to select larger blocks of text quickly.
- Drag to Select: Improved drag-to-select functionality allows users to select text more precisely by dragging across the desired text area. This enhancement provides a more intuitive and fluid text selection experience.
Impeller Graphics Engine Updates
- Flutter 3.24’s updates to the Impeller graphics engine improve both performance and visual quality.
- Developers can create high-quality, visually impressive apps with smoother performance and better resource management.
- Enhanced graphical capabilities reflect Flutter’s commitment to high performance and modern visuals.
- It has also tackled several issues that have significantly improved Impeller’s text rendering in this release. Now, text weight, spacing, and kerning match the quality of the legacy renderer.
Improved Defaults for Downscaled Images
In this release, the default FilterQuality for images is now set to Medium instead of Low. This change helps prevent images from appearing pixelated and improves rendering speed, especially when a large image is scaled down significantly.
Enhanced DevTools & IDE
Flutter 3.24 introduces enhancements to DevTools, including improved memory profiling and new debugging features. These updates help you identify performance bottlenecks and optimize your application more efficiently.
Network Profiler
- Polish and Bug Fixes: The Network Profiler tool has received updates to address critical bugs and improve its functionality. This includes better handling of network requests and responses, and more accurate performance metrics.
- Improved Usability: Enhancements have been made to make it easier to analyze network traffic and debug issues related to network communication.
Flutter Deep Links Tool
- Bug Fixes: The Flutter Deep Links tool has been updated to fix critical issues, ensuring that deep linking functionalities work as expected.
- Enhanced Experience: Improvements have been made to make it more reliable and user-friendly, helping developers manage and troubleshoot deep linking scenarios more effectively.
Breaking changes and deprecations
Replacement of onPopPage with onDidRemovePage
- onDidRemovePage replaces onPopPage for handling page removal without veto capability.
- Page.canPop and Page.onPopInvoked provide the new mechanism for vetoing pops and handling pop requests.
Generic Type Added to PopScope
- Generic Type <T>: The PopScope class now supports a generic type to handle specific data types in pop callbacks.
- onPopInvokedWithResult: Replaces the deprecated onPopInvoked to handle pop events with associated results or data.
Shared Preferences Plugin Updates
Shared Preferences plugin include the introduction of SharedPreferencesAsync and SharedPreferencesWithCache. Here’s a detailed explanation:
SharedPreferencesAsync:
- Enhances application performance by offloading preference operations to background threads.
- Reduces UI latency and improves user experience, particularly in data-intensive applications.
SharedPreferencesWithCache:
- Speeds up read operations by reducing the frequency of disk access.
- Ideal for applications with settings or preferences that are read frequently but updated infrequently.
Monetization
Support for video ad monetization, allowing developers to integrate video ads into their apps, enhancing revenue opportunities (Flutter – Build apps for any screen).
These updates collectively aim to provide a more powerful, efficient, and user-friendly development experience. For more detailed information, you can refer to the official release notes.
TreeView Package
The flutter_treeview package, available on pub.dev, allows developers to implement hierarchical data structures with ease.
Updates in the Cupertino library
The Cupertino library has received several updates to enhance its iOS-like appearance and functionality.
- Haptic Feedback Improvement: CupertinoActionSheet buttons now provide better haptic feedback, making interactions more responsive.
- Button and Text Field Enhancements:
The font size and weight for CupertinoActionSheet buttons have been adjusted to match iOS more closely.
New focus properties in CupertinoButton offer better control over button states.
The color of disabled CupertinoTextField can now be customized for more flexible UI design.
- Bug Fixes and Accessibility Improvements: Issues with auto-fill in text fields and general accessibility have been fixed, making the library more robust.
- Expanded Widget Catalog: 37 new Cupertino widgets have been added, giving developers more options for iOS-styled components.
Enhanced Sliver components
There are new sliver components introduced to enhance layout flexibility:
- PinnedHeaderSliver: It keeps the header pinned at the top while the user scrolls, providing a consistent point of reference.
- SliverResizingHeader: This provides a header that can change its size dynamically based on the scroll offset, offering a more interactive and responsive design.
CarouselView Widget
A new CarouselView widget has been added, which provides a scrollable list of items that dynamically resize as they enter and exit the view. This widget aligns with the Material Design’s carousel layout and offers a seamless scrolling experience.
Acknowledgments
I’d like to extend my gratitude to Flutter and Kevin Chisholm for their valuable insights on Flutter 3.24. Their documentation and articles provided crucial information and guidance for this blog. For more details, you can explore their work here:
Conclusion
Flutter 3.24 introduces new features, performance boosts, and important updates to help developers create high-quality apps. This release enhances DevTools, improves rendering, and includes platform-specific updates. New widgets, updated APIs, and bug fixes make development smoother and more efficient. By using Flutter 3.24, developers can improve their projects and deliver better user experiences.
For more details on what’s new in Flutter 3.24, check out these resources:
Reference Links
- Flutter 3.24 Release Notes – Comprehensive overview of the latest features and improvements.
- Flutter DevTools Documentation – Official documentation for the updated DevTools and performance profiling.
- Flutter API Documentation – Detailed information on new and updated Flutter APIs and widgets.
- Flutter Platform-Specific Updates – Insights into platform-specific enhancements for iOS, Android, and web.
- Migration Guide – Guidance on handling breaking changes and updating your codebase.