A few days ago, Flutter 2.10 released the official version, which is less than two months away from the release of the previous version, but even in such a short period of time, Flutter has closed 1843 issues and merged 1525 PRs.
In version 2.10, major updates include a major update to Flutter's Windows support, several notable performance improvements, new support for icons and colors in frames, and some tooling improvements. Additionally, we got some updates about removing the Dev Channel, reducing support for older versions of iOS, and some breaking changes.
Flutter Windows desktop support enters the stable version
The purpose of the Flutter cross-platform framework is to create a cross-platform application solution that can be beautifully built, highly customizable, and compiled into machine code, so as to give full play to the full graphics rendering capabilities of the underlying hardware of the device. Now, Flutter's official support for production versions of Windows marks the fulfillment of that vision. It enables Windows developers to enjoy the same productivity and functionality of mobile development.
Of course, in addition to using most of the common Flutter frameworks on iOS and Android, Flutter applications on Windows can also use Windows-specific features such as Win32, COM, and Windows Runtime APIs as needed. At the same time, Google also updated some common Flutter plugins to support Windows, such as camera, file_picker and shared_preferences plugins.
If you want to learn more about Flutter For Windows , this article provides an in-depth introduction to the Flutter architecture on Windows, allowing Flutter packages and plugins to support Windows.
performance improvements
This version of Flutter provides support for dirty area management proposed by community member knopp. If enabled, repaints can be performed for a single dirty region on iOS/Metal . The benefit of this change is a 90 to 99 percent reduction in rasterization time on some benchmarks (so-called rasterization, the process of converting an image represented in a vector graphics format into a bitmap for display or printer output) ) and reduced GPU utilization on these benchmarks from over 90% to less than 10%, as shown in the graph below.
And, we hope to bring the benefits of partial repaints to other platforms in future releases.
In Flutter version 2.8, we got the recording process of pictures. In Flutter 2.10, we have started to optimize the build process. One of the most notable examples is that the time taken for the frame raster in the benchmark dropped to less than a third of what it took before we built the opacity layer.
As we get deeper into the image building pipeline, we hope to be able to expand this optimization to more use cases.
In profile and release modes, Dart code is compiled into machine code ahead of time. The key to the efficiency of this code, though, is full program type flow analysis, which unlocks many compiler optimizations and aggressive tree-like optimizations. However, it can be a bit expensive since typeflow analysis has to cover the entire program. This release includes a faster type flow analysis implementation of . From the point of view, the overall build time of Flutter applications dropped by about 10% after using the new build method.
As with previous releases, performance enhancements, reduced memory usage, and reduced latency are top priorities for the Flutter team, and we look forward to further improvements in future releases.
iOS update
In addition to performance improvements, we've also added platform-specific feature and functionality enhancements. luckysmg can make the keyboard animation smoother on iOS. When the soft keyboard needs to be popped up, the new animation effect will be smoother without the need to do anything in development.
We've also improved the stability of the iOS camera plugin and fixed some edge-case crashes. Finally, 64-bit iOS architecture compressed pointers with reduced memory usage.
We know that 64-bit architectures are capable of representing pointers as 4-byte data structures. When there are many objects, the space occupied by the pointer itself can increase the total memory usage of the application, especially when encountering a complex application where there are more garbage collections. However, it is unlikely that an iOS application will have enough objects to request a 32-bit address space, let alone a larger 64-bit address space.
Dart version 2.15 provides compressed pointers, which can reduce the memory usage of 64-bit iOS applications. For a related introduction, see: Dart 2.15 blog post for details.
Android update
Of course, this release also includes many improvements for Android. We know that by default, when we create a new Flutter app, Flutter supports the latest version of Android by default. Additionally, with this release, we have also automatically enabled multidex support. If your application supports Android SDK version lower than 21 and exceeds the 64K method limit, just add --multidex
attribute when using the flutter build appbundle
or flutter build apk
command.
Finally, we also fixed a Gradle bug reported by the community. It is also for this reason that when creating a Flutter application, we need to add the minimum supported Android SDK version as shown below.
Of course, we continue to track community feedback issues and propose fixes in the latest release.
web update
There are also some improvements on the web side of this release. For example, in previous versions, when scrolling to the edge of a multi-line TextField on the web, it would not scroll properly. This release introduces edge scrolling for text selections, and when the selection is moved outside the text field, the field can also be scrolled to see the scroll range. This new behavior applies to web and desktop applications.
In addition, this version also provides several other improvements to improve web performance. We're always looking for a way to reduce web performance overhead. In previous versions, we wanted to bring a native HTML widget into a Flutter app, we needed to override the HTML widget as part of supporting the web. If you have a lot of native HTML widgets in your app, like links, this will add a lot of overhead. In this release, we've created a new "undrawn platform view" for the web that essentially removes this overhead. We've taken advantage of this optimization for the Links widget, which means that if you have a lot of links in your web application, there won't be any significant overhead.
material
In this version we have also upgraded the overall color scheme, including support for gradient colors.
final lightScheme = ColorScheme.fromSeed(seedColor: Colors.green);
final darkScheme = ColorScheme.fromSeed(seedColor: Colors.green, brightness: Brightness.dark);
There is a new colorSchemeSeed parameter in the ThemeData function that allows developers to generate the desired theme color scheme:
final lightTheme = ThemeData(colorSchemeSeed: Colors.orange, …);
final darkTheme = ThemeData(colorSchemeSeed: Colors.orange, brightness: Brightness.dark, …);
Additionally, this release provides the ThemeData.useMaterial3
parameter to switch the component to the new Material3 look and feel. And, we also added 1028 new material icons.
Integration test improvements
In December 2020, we provided a integration_test package for end-to-end testing of . This new package replaces the flutter_driver package as the recommended way for integration testing, and also provides new features such as Firebase Test Lab support, as well as support for web and desktop.
Since then, we've made further improvements in integration testing, including bundling the integration_test package into the Flutter SDK itself, making it easier to integrate with applications. If you want to migrate your existing flutter_driver tests to integration_test, we also provide migration guide .
The official Flutter documentation, samples, and code have also been updated with integration_test. To learn more about integration_test, click Testing Flutter apps .
Flutter DevTools
In this release, we've also upgraded and updated Flutter DevTools, including an easy-to-use feature that downloads and executes the latest version if we use DevTools from the command line instead of using pub global activation. Well, now we can now also use the dart devtools
command to get the latest version.
We've also made some usability updates, including improved support for inspecting large lists and maps in the Debugger variables pane.
Finally, we sincerely invite you to provide the DevTools experience and feedback to us in the development of the official university, which will help us to make deeper improvements and optimizations.
VSCode improvements
In addition, Visual Studio's support for Flutter has also been further enhanced, including color previews in more places in the code and color picker , which can facilitate viewing effects during development.
Also, if you want to be a tester for Dart and Flutter pre-release versions of VSCode, you can switch to pre-release versions in the extension settings.
If you want to know more details and content, you can refer to:
remove dev channel
In Flutter 2.8 release, we announced that we are working on removing the dev channel, simplifying your choices and reducing development overhead. In this release, we've done that, including:
- Update Flutter tooling to help migrate developers out of the dev channel
- Updated wiki descriptions and commitments for each channel
- Update deprecation policy
- Removed support for the dev channel from DartPad, pre-commit testing, and the website
The Dev channel has now been completely removed. Please let us know if we missed some locations that haven't been removed.
Support for iOS 9.3.6
Due to reduced usage and increased maintenance difficulty of target devices in our labs, we are adjusting support for iOS 9.3.6, from "supported" to "best effort" . This means that support for iOS 9.3.6 and support for 32-bit iOS devices will only be maintained 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 the minimum iOS version supported by Flutter will be increased to iOS 11.
major changes
We've also worked hard to reduce breaking changes with each release and this release, and while we're not quite there yet, we'll keep working on it.
- Required Kotlin version
- Deprecated API removed after v2.5
- Raw images on Web uses correct origin and colors
- Scribble Text Input Client
If you are still using these APIs, you can read the migration guide on . As always, a big thank you to the community for contributing tests that help us identify these breaking changes.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。