Flutter version 2.10 has been released! Although it has been less than two months since the last stable release, even in that short time we have processed and closed 1,843 issues and consolidated 1,525 PR from 155 contributors around the world. Thank you all for a job well done during the holidays at the end of 2021.
We have several exciting things to announce, including a major update to Flutter support for Windows, several major performance improvements, new support for ICONS and colors in the framework, and some tool improvements. The release also includes updates to remove the Dev channel, reduced support for older versions of iOS, and a few brief disruptive changes. Let’s get started!
Building Windows desktop application support with Flutter has reached a stable stage
First of all, Flutter 2.10 brings stable Windows support. There is no need to configure support for Windows desktop applications individually with the — enable-Windows-desktop flag because it is now enabled by default!
Of course, there’s more to this stable release than just “deleting” a tag; Windows support for Flutter 2.10 also includes extensive improvements to text processing, keyboard processing and keyboard shortcuts, new ways to integrate directly with Windows, support for command-line arguments, globalized text entry, and accessibility features.
For more information on the Windows Stable release, you can read another post today that details the architecture of Flutter on Windows and explains how many Flutter packages and plug-ins already support Windows. You can also check out some examples of Flutter created by our tools and application partners on Windows.
Engine performance improvements
This version of Flutter includes initial support for drawing dirty areas management provided by community member Knopp, who enables selective repainting of individual dirty areas on iOS/Metal. This change reduced rasterization times in the 90th and 99th percentiles by an order of magnitude in some benchmarks, and reduced GPU utilization in these benchmarks from above 90% to below 10%.
We hope to bring the benefits of selective redrawing to other platforms in future releases.
2.8 in a Flutter. In Flutter 2.10, we have started using it (DisplayList) for optimization. For example, a common opaque layer situation has now been implemented in a more efficient way. Even in the worst case, the rasterization time per frame in our benchmark fell to less than a third of its previous value.
We will continue to extend this optimization to more scenarios in the future as we continue to develop the record format.
Dart code is compiled in AOT mode in profile and Release mode. The key to this code’s lightness and efficiency comes from type flow analysis throughout the program, which unlocks a lot of compiler optimization and radical tree-shaking. However, because type flow analysis must cover the entire program, there may be some drain on performance. The new version brings a faster implementation of type flow analysis. In our benchmark tests, the overall build time for Flutter applications decreased by about 10%.
As always, performance enhancements, reduced memory usage, and reduced latency were the priority for the Flutter team. Look forward to further improvements in future releases.
Update for iOS
In addition to performance improvements, we have added and enhanced some platform-specific features. Luckysmg brings us a new iOS enhancement — smoother keyboard animations that automatically apply to your app.
In addition, we also improved the stability of the iOS camera plugin by fixing some edge crashes.
Finally, we’ve added a new feature for 64-bit iOS to reduce memory usage: compressed Pointers.
The 64-bit architecture represents Pointers as 4-byte data structures. When you have a large number of objects, the space taken up by the Pointers themselves can increase the overall memory footprint of your application, especially if your application is larger and more complex and has more GC jitter. However, iOS apps are unlikely to have enough objects to take up most of the 32-bit address space (2 billion objects), let alone the massive 64-bit address space (90 billion objects).
Dart 2.15 introduced the pointer compression feature. In this Release of Flutter, we use this feature to reduce the memory usage of 64-bit iOS applications. You can check out the Dart 2.15 blog post for details.
Dart 2.16 stable release was released at the same time. Stay tuned for an update to Dart 2.16 that will be released at a later date.
Android Updates
Flutter version 2.10 also contains a number of improvements for the Android platform. Flutter now supports the latest version of Android, Android 12 (API level 31), by default when you create new applications. Also, in this release, we have enabled multidex automatic support. If your app supports Android SDK versions less than 21 and exceeds the dex method limit of 64K, Simply pass the –multidex argument to the flutter Build AppBundle or the flutter Build apk command to add multidex support to your application.
Finally, after we received feedback from developers about Gradle throwing confusing error messages, we tweaked the Flutter command line tool and it now provides solutions to common problems. For example, if you add a plugin to your app that requires you to upgrade the lowest supported Android SDK version, you will now see suggestions for a “Flutter Fix” in the error message.
We’ll continue to add suggestions for more workarounds for common error messages, and hope to get your feedback on other error messages that could significantly help developers deal with similar issues.
Web Platform Update
This release also includes some improvements to the Web platform. For example, in previous versions, when the mouse was dragged over the edge of a multi-line text box, it did not follow the scroll correctly. In this version, when the selection cursor drags out the text box, the text box scrolls, browses and selects the corresponding text content. This behavior applies to both the Web platform and the desktop.
Flutter 2.10 also includes another significant improvement to the Web platform. We have also been looking to reduce the overhead of running Flutter applications to the Web platform. In previous versions, every time we wanted to introduce native HTML widgets to Flutter applications, We all need an Overlay as part of our Platform view support for the Web. Each of these layers supports custom drawing, but also represents a certain amount of performance overhead. If your application has a large number of native HTML widgets (such as links), this can be a significant performance overhead. In this release we built a new “unpainted platform view” for the Web platform that has largely eliminated this overhead. We have applied this optimization to the Link widget, which means that if you have a large number of links in your Flutter Web application, they will no longer incur additional performance costs. Over time, we will apply this optimization to other widgets.
Material 3
This release is the beginning of the transition to Material 3, which includes the ability to generate an entire color scheme from a single seed color.
You can create a new ColorScheme type using any color:
final lightScheme = ColorScheme.fromSeed(seedColor: Colors.green);
final darkScheme = ColorScheme.fromSeed(seedColor: Colors.green, brightness: Brightness.dark);
Copy the code
The ThemeData constructor also has a new colorSchemeSeed argument that generates the theme’s color scheme directly from the color:
finallightTheme = ThemeData(colorSchemeSeed: Colors.orange, ...) ;finaldarkTheme = ThemeData(colorSchemeSeed: Colors.orange, brightness: Brightness.dark, ...) ;Copy the code
In addition, this release includes an argument to themeData.usematerial3, which switches widgets to the new Material3 look and feel.
Finally, we added 1028 new Material ICONS.
You can follow up the Material 3 access situation in this issue, and leave your feedback at any time.
Integration test improvement
In December 2020, we announced a new approach to end-to-end testing using Integration_test. See the Chinese documentation for the Introduction to Integration Testing to learn more. This new package replaces Flutter_driver as the recommended way to do integration testing, providing new features such as Firebase test lab support and Web and desktop support.
Since then, we have made further improvements to integration testing, including building the Integration_test package into the Flutter SDK to make it easier to integrate with your application. We have now written a new migration guide to help you migrate from Flutter_driver tests to Integration_tests.
The existing documentation, samples, and Codelab have also been updated for Integration_test. If you are not already using integration_test on the Flutter app, start now!
DevTools
In this release we have also made some improvements to Flutter DevTools, including an easy way to use DevTools directly from the command line. Now you don’t need to use Pub Global Activate to download and run the latest version of DevTools. Simply use Dart DevTools to get the latest version of Flutter that you are using.
We also made some usability updates, including improved support for checking large lists and maps in the debugger variables pane (thanks to Elliott).
Finally, we’re about to release our annual DevTools survey! Please provide your feedback and help us improve your development experience.
VSCode improvement
The Visual Studio Code extension to Flutter also gets a number of enhancements, including preview colors in more places in the Code and a color picker that updates the color Code.
In addition, if you want to be a tester for pre-release versions of VSCode’s Dart and Flutter extensions, you can switch to pre-release versions in your extension Settings.
You can read more about this update in this article on the flutter- Announce mailing list.
Remove the Dev release channel
With Flutter 2.8, we announced that we are working to remove the Dev release channel to simplify your choices and reduce development costs. In this release, we have done this work, including:
- Update the Flutter tool to help migrate developers out of the development channel
- Update the wiki’s description and commitment to each channel
- Update deprecation policy
- Remove dev channel support from DartPad, pre-commit tests, and websites
The Dev channel has now been completely removed. Please let us know if we have missed any positions that have not been removed.
IOS 9.3.6 support is coming to an end
Due to reduced use of target devices in our lab and increased maintenance difficulties, we are adjusting our support for iOS 9.3.6 from “support” to “best efforts”. This means that support for iOS 9.3.6 and support for 32-bit iOS devices will be maintained only through coding practices, ad-hoc, and community testing.
We expect to drop support for 32-bit iOS devices and iOS versions 9 and 10 in the stable release of Flutter in Q3 2022. This means that apps built on the stable Flutter SDK will no longer run on 32-bit iOS devices, and that the minimum iOS version of Flutter support will be increased to iOS 11.
Destructive modification
We’re also working hard to reduce the number of disruptive changes in each release and this one, and while we’re not at zero yet, we’ll keep working on that!
- Build the Kotlin version of the Flutter application later than 1.5.31
- Deprecated API removed after Flutter 2.5
- Raw images on the Web use the correct source and color
- Apple Pencil conveniently write TextInputClient changes
If you are still using these apis, you can read the migration guide on flutter.cn. As always, we would like to thank the community for contributing tests to help us identify these disruptive changes.
conclusion
On behalf of all the Members of the Google Flutter team, thank you for being a part of the community! With the help of the community, Flutter has become the most popular cross-platform UI tool. While stable support for Windows is just beginning, we are already looking forward to what we will build together!
Thank you
- What’s New in Flutter 2.10
- Link: medium.com/flutter/wha…
- Translation: Alex
- Proofread: Vadaski/Luke
- Drawing: Lynn