What’s new in the docs | Flutter

What’s new in the docs | Flutter

An In-Depth Look at the Latest Updates from the Flutter Documentation Team

As a seasoned IT professional, I’m excited to dive into the recent advancements and updates in the world of Flutter, the popular open-source mobile app development framework. The Flutter documentation team has been hard at work, delivering a wealth of new features, improvements, and insights that every Flutter developer should be aware of.

Streamlining Navigation and Interaction with New Slivers

One of the standout additions in the latest Flutter release is the introduction of a set of new slivers that allow for more dynamic and customizable app bar behaviors. These new slivers, such as the PinnedHeaderSliver, StickyHeaderSliver, and ResizableHeaderSliver, give developers greater flexibility in how they design and implement their app’s scrolling and header experiences.

For example, the PinnedHeaderSliver can be used to recreate the same effect as the iOS Settings app’s app bar, where the header stays pinned to the top of the screen as the user scrolls. The updated sample code in the documentation provides a clear illustration of how these new slivers can be composed together to achieve complex scrolling behaviors.

Enhancing the Cupertino Library

Flutter’s Cupertino library, which provides a set of widgets that adhere to the iOS design language, has also received some notable improvements in this release. The team has focused on enhancing the fidelity of the CupertinoActionSheet widget, adding haptic feedback when sliding across the action sheet’s buttons and ensuring that the font size and weight match their native counterparts.

Additionally, new focus properties have been added to the CupertinoButton, and developers can now customize the color of a disabled CupertinoTextField. These enhancements demonstrate the Flutter team’s commitment to improving the overall user experience and visual consistency of Cupertino-based apps.

Introducing the Two-Dimensional Scrollables Package

Another exciting development in this Flutter release is the introduction of the two_dimensional_scrollables package, which includes the TreeView widget and several accompanying classes. This package enables the creation of performant scrolling trees that can move in both the horizontal and vertical directions as the tree grows.

The package’s sample app has been updated with various examples showcasing the use of the TableView and TreeView widgets, providing developers with a solid starting point for building their own complex scrolling interfaces. The TreeSliver was also added to the framework, allowing developers to seamlessly integrate tree-based content into their one-dimensional scrolling layouts.

Material Design Carousel Widget

In this release, Flutter has introduced the CarouselView widget, which brings a Material Design-inspired carousel layout to your applications. The CarouselView presents an “Uncontained” layout, where the scrollable list of items can extend beyond the container’s boundaries, and the leading and trailing items can dynamically change size as they scroll in and out of view.

This new widget offers developers a polished and customizable way to incorporate carousel-style content into their Flutter apps, enhancing the overall user experience and visual appeal.

Relocating Core Widget Logic

This release also includes efforts to relocate core widget logic that is not design-specific from the Material library into the Widgets library, making it more broadly accessible and reusable. This includes improvements to the AnimationStatus enum, such as the addition of new getters and a toggle() method to the AnimationController.

These changes demonstrate Flutter’s commitment to modularizing and streamlining its core functionality, allowing developers to leverage powerful features without being tied to a specific design language or widget set.

Impeller Improvements and Android Preview

In preparation for the upcoming removal of the Impeller opt-out on iOS, the Flutter team has been working diligently to improve Impeller’s performance and fidelity. Significant advancements have been made in text rendering, leading to a dramatic reduction in jank when scrolling large collections of emojis, and improved text weight, spacing, and kerning to match the legacy renderer.

The team is also continuing to preview Impeller on Android, though the process has been slowed by a bug in Android 14 that affects the APIs used by Impeller for Platform Views. To ensure a seamless experience across a wide range of devices, the team is holding off on making Impeller the default renderer until a stable release later this year. Developers are encouraged to upgrade to the latest stable version and provide feedback on any issues they encounter with Impeller on Android.

Introducing Flutter GPU

One of the most exciting announcements in this release is the introduction of Flutter GPU, a major update to Flutter’s rendering capabilities. This low-level graphics API allows developers to create custom renderers using Dart code and GLSL shaders, without the need for any native platform code.

The Flutter GPU feature enables advanced graphics and 3D scenes to be rendered directly within Flutter, expanding the possibilities for developers creating games, visualizations, and other visually-intensive applications. While currently in an early preview stage, the team is committed to improving the functionality and stability of Flutter GPU in the coming months, with the goal of eventually supporting all Flutter platforms.

Developers interested in leveraging the power of Flutter GPU can switch to the main channel and add the flutter_gpu package to their projects. Keep an eye out for upcoming blog posts and resources that will dive deeper into the capabilities and implementation of this groundbreaking feature.

Enhancing Flutter Web with Multi-View Embedding

Another significant addition to this Flutter release is the introduction of multi-view embedding for Flutter web applications. This feature, also known as “embedded mode,” allows developers to render content into multiple HTML elements simultaneously, offering increased flexibility for integrating Flutter views into existing web applications.

In multi-view mode, a Flutter web app doesn’t render immediately upon launch; instead, it waits until the host application adds the first “view” using the addView method. The host application can then dynamically add or remove these views, and Flutter will adjust its widgets accordingly.

This capability is particularly useful for developers who need to integrate multiple, independent Flutter views into complex web applications, enabling them to create more dynamic and personalized user experiences. The detailed documentation provides a comprehensive guide on implementing multi-view embedding in your Flutter web projects.

Monetization Support with the IMA Plugin

In this release, Flutter has launched a new Interactive Media Ads (IMA) plugin to support instream video ad monetization on mobile apps. This new plugin complements the existing Google Mobile Ads (GMA) plugin, which primarily focuses on display ad formats, by providing new revenue opportunities through instream video ads.

The IMA plugin supports pre-roll video ads on both Android and iOS platforms, with plans to add support for midroll ads in the near future. Developers can now explore the new IMA plugin and integrate it into their Flutter apps, leveraging the power of instream video ads to generate additional revenue streams.

Swift Package Manager Support

Flutter 3.24 also introduces early support for Swift Package Manager, which brings several benefits to developers working on iOS and macOS platforms. This includes access to the growing ecosystem of Swift packages, as well as a simplified Flutter installation process, as Swift Package Manager is bundled with Xcode, eliminating the need for Ruby and CocoaPods.

The Flutter team encourages plugin authors to explore adding support for Swift Package Manager to their plugins and to provide feedback on their experiences. This is an exciting step forward in Flutter’s integration with the Apple ecosystem, and it will be interesting to see how the community embraces this new capability.

Shared Preferences Updates

The popular shared_preferences plugin has received some significant updates in this release, including the addition of two new APIs: SharedPreferencesAsync and SharedPreferencesWithCache.

The most notable change is that the Android implementation now uses the Preferences DataStore instead of Shared Preferences, which can provide better performance and reliability for certain use cases. The SharedPreferencesAsync API allows direct access to the platform’s most up-to-date preferences, while the SharedPreferencesWithCache API offers a locally cached version for faster, synchronous access.

These new APIs are intended to eventually replace the current SharedPreferences API, although the Flutter team acknowledges that this is a widely-used plugin, and the ecosystem will need time to transition to the new APIs.

Enhancements to the Flutter DevTools Tooling

The Flutter 3.24 release also includes several exciting improvements to the Flutter DevTools tooling suite. One notable addition is the new “Rebuild Stats” feature in the Performance tool, which allows developers to capture information about how many times a widget was built in their app or even within a specific Flutter frame.

Other improvements include polish and critical bug fixes to tools like the Network profiler and the Flutter Deep Links tool, as well as general enhancements to provide a better overall user experience when using DevTools from within an IDE, such as the improved Flutter Sidebar in Visual Studio Code.

Additionally, the DevTools Extensions framework has received major improvements, enabling the use of DevTools extensions (tools provided by package dependencies) when debugging Dart or Flutter tests, or even when writing code without an active debugging session. This opens up new possibilities for developers to build and leverage custom tooling within their Flutter projects.

Breaking Changes and Migration Guidance

As with any major release, Flutter 3.24 includes some breaking changes that developers should be aware of. These include changes to the Navigator‘s pages API, generic types in PopScope, and the default renderer for Flutter web. The Flutter team has provided detailed migration guidance on the breaking changes page to assist developers in updating their applications.

The community’s contributions to the testing process have been instrumental in identifying these breaking changes, underscoring the importance of the collaborative efforts that drive Flutter’s continued evolution.

Conclusion

The Flutter 3.24 release is a testament to the hard work and dedication of the Flutter team and the ever-growing Flutter community. From the introduction of innovative new slivers and Cupertino enhancements to the groundbreaking Flutter GPU capabilities and improvements to the DevTools suite, this release offers a wealth of valuable updates and insights for Flutter developers.

As an experienced IT professional, I’m excited to see the continued advancements in the Flutter framework and the endless possibilities it presents for building high-quality, cross-platform mobile and web applications. I encourage all Flutter developers to explore these new features, provide feedback, and continue contributing to the growth and success of this remarkable technology.

To stay up-to-date with the latest Flutter developments, be sure to follow the IT Fix blog and the official Flutter documentation. Happy coding!

Facebook
Pinterest
Twitter
LinkedIn

Newsletter

Signup our newsletter to get update information, news, insight or promotions.

Latest Post