Original link: medium.com/flutter/wha…
Welcome to the update to the stable version of Flutter 2.10. It has been less than two months since its last release, but even in this short time, Flutter 2.10 has closed 1,843 issues and incorporated 1,525 PR’s from 155 contributors around the world. So thank you all so much for your excellent work during this time, especially during the holidays of 2021.
As an important part of this release, here are a few exciting things to announce, including:
- A major update to Flutter support for Windows;
- Some significant performance improvements;
- New support for ICONS and colors in frames
- Some handy improvements to development tools;
There are also updates to remove dev Channel, reduced support for older versions of iOS, and a short list of important changes.
Get ready for production applications on Windows
First of all, Flutter 2.10 has brought us stable Windows support. Now developers can no longer enable Windows support by setting flags, because Compilation of Windows applications is now supported by default on Flutter 2.10
Of course, this release also includes improvements to text processing, keyboard processing and keyboard shortcuts, as well as better integration with Windows, support for command-line arguments, global multilingual text input and accessibility.
For more information about the Windows Stable release, see the Flutter for Windows blog post, which describes the architectural implementation of Flutter on Windows and gives you an idea of how many Flutter packages and plug-ins already support Windows. You can also check out some of the demos that our tools and application partners have done with Flutter on Windows!
Performance improvements
Flutter 2.10 includes support for dirty zone management provided by Flutter community member Knopp. He enabled partial redrawing of individual dirty zones on iOS/Metal. This change reduced rasterization times by 90% to 99% in benchmark tests. And reduce GPU utilization from over 90% to less than 10%.
We hope to support the benefits of this redrawing to other platforms in future releases.
In The 2.8 version of Flutter, we released our own Picture recording format. Now we start to use it to optimize functions in Flutter 2.10, for example, now Flutter can implement opacity layers more easily. Even in the worst case, frame raster times in the benchmark dropped by less than a third.
As we continue to develop the Picture Recording format, it is anticipated that these optimizations can be extended to more scenarios.
In profile and Release mode, Dart code is compiled to native code ahead of time. The key to improving performance and reducing its size is type flow analysis throughout the application, which unlocks a lot of compiler optimizations and radical tree-shaking.
However, because Type Flow analysis must cover the entire application, it can be somewhat expensive, so this release adds a faster implementation of Type Flow analysis. In our benchmark, the overall build time of the Flutter application decreased by about 10%.
As always, enhancing performance, reducing memory usage and reducing latency are the priority for the Flutter team and we look forward to further improvements in future releases.
The iOS update
In addition to performance improvements, we’ve added some platform-specific enhancements. One of the new features is smoother keyboard animations for iOS from LuckySMG, which will be applied to your App by default without you having to do anything.
And we did it by fixing someThe edgeUnder the condition ofcollapsethesituationTo improve the stability of the iOS camera plugin.
Finally, the 64-bit iOS architecture can reduce memory usage by compressing Pointers.
64-bit architectures represent Pointers as 4-byte data structures. When you have a lot of objects, the amount of space taken up by Pointers can increase the overall memory usage of your APP, especially if your APP is large and complex, leading to more GC loss. But it’s unlikely that a large percentage of iOS apps have objects that need to occupy the 32-bit address space (2 billion objects), let alone the massive 64-bit address space (90 billion objects).
Dart 2.15 provides compression Pointers. In this Version of Flutter, we use them to reduce the memory usage of 64-bit iOS applications. You can check out the Dart 2.15 blog post for more information.
While reading the Dart blog post, don’t forget to check the Dart 2.16 announcement for updates to support Flutter for Windows, including the package platform tag and the new search experience on pub.dev.
The android update
This release also includes a number of improvements for Android.
By default, Flutter supports the latest Android version 12 (API level 31) when creating new applications. In addition, Flutter automatically enables Multidex support in this version.
If your app supports Android SDK versions lower than 21 and exceeds the 64K method limit, To enable your application to support Multidex, simply pass the –multidex flag to flutter Build AppBundle or Flutter Build APK.
Finally, the Flutter tool now provides common troubleshooting steps when a Gradle error occurs. For example, if you add a plugin to your app that requires you to upgrade the lowest Android SDK version, you will now see suggestions for the Flutter Fix in the log.
The Web update
This release also contains some improvements to the Web.
For example, in previous versions, scrolling a multi-line TextField on the Web to the edge didn’t scroll correctly, The Flutter 2.10 edge scrolling for Text Selection allows users to scroll beyond the TextField. This update applies to Web and desktop applications.
Additionally, Flutter includes another significant improvement over the Web: reducing the overhead of mapping Flutter to the Web.
In previous versions, every time we wanted to introduce native HTML controls into the Flutter application, we needed an overlay as our support for the platform view of the Web. Each of these overlay layers supported custom drawing but also represented a certain amount of overhead.
If you have a large number of native HTML widgets (such as links) in your application, this can add significant performance overhead. In this release, we created a new “non-painting Platform view” for the Web that basically eliminated this overhead.
We have already taken advantage of this optimization for the Link control. This means that if you have many links in your Flutter Web application, they will not have any significant overhead, and over time we will apply this optimization to other controls.
Material 3
Flutter version 2.10 is the beginning of the transition to Material 3, which includes the ability to generate an entire color scheme from single seed Color.
You can construct a ColorScheme instance using any color:
final lightScheme = ColorScheme.fromSeed(seedColor: Colors.green);
final darkScheme = ColorScheme.fromSeed(seedColor: Colors.green, brightness: Brightness.dark);
Copy the code
ThemeData’s factory constructor also has a new colorSchemeSeed argument that generates the theme’s color scheme:
finalLightTheme = ThemeData(colorSchemeSeed: Colors. Orange,...) ;finalDarkTheme = ThemeData (colorSchemeSeed: Colors. Orange, brightness, brightness, dark,...). ;Copy the code
In addition, this release includes the ThemeData.usematerial3 identifier, which is used to switch components to the new Material3 lookingsupport.
Finally, we added 1,028 new Material ICONS.
Integration test improvement
Starting in December 2020 we announced a new approach to end-to-end testing using the Integration_test package, which replaces the Flutter_driver package as the recommended way to do integration testing, Provides Web and desktop support such as Firebase Test Lab.
Since then we have made further improvements to integration testing, including bundling the Integration_test package into the Flutter SDK itself to make it easier to integrate with developers’ applications.
If you want to move the existing flutter_driver test to integration_test, can refer to the migration guide: docs. Flutter. Dev/testing/int…
Flutter development tool
We have also made some changes to Flutter DevTools in this release, including making it easier to use DevTools from the command post. The updated version can now be downloaded and executed directly through Dart DevTools instead of pub Global Activate.
We also made a number of usability updates including improved support for checking large lists and mappings in the variables pane (thanks to Elliette).
VSCode improvement
The Visual Studio Code extension to Flutter also gets a number of enhancements, including color previews for more locations in Code and color pickers to update Code.
Additionally, if you want to become a tester for pre-release versions of VSCode’s Dart and Flutter extensions, you can switch to pre-release versions in the extension Settings.
Delete the development channel
Flutter 2.8 has announced that we are working to remove the Dev Channel to simplify developer choices and remove engineering overhead, and in this release we have done this, including:
- Updated the Flutter tool to help migrate developers out of the Dev Channel
- The wiki was updated to reflect the update
- Deprecation policy has been updated
- Dev Channel support was removed from DartPad, pre-commit tests, and websites
IOS 9.3.6 is no longer supported
Due to reduced use and increased maintenance difficulties of target devices in the lab, support for iOS 9.3.6 is now being moved from the ‘support’ layer to the ‘best efforts’ layer, meaning that support for iOS 9.3.6 and support for 32-bit iOS devices will only be maintained through temporary fixes and community testing.
Docs. Flutter. Dev/development…).
In the stable release of Flutter in Q3 2022, we expect to drop support for 32-bit iOS devices and iOS versions 9 and 10 from the Stable release of Flutter. This means that apps built on the stable Flutter SDK will no longer run on 32-bit iOS devices after that, and the minimum iOS version of Flutter support will be increased to iOS 11.
A major change
- The Kotlin version: docs. Flutter. Dev/release/bre…
- After the v2.5 deleted have been deprecated API: docs. Flutter. Dev/release/bre…
- Original image on the Web using the right source and color: docs. Flutter. Dev/release/bre…
- Scribble Text Input Client: docs. Flutter. Dev/release/bre…
If you’re still using these apis, you can read the migration guide on Flutter. Dev and, as always, thanks a lot to the community for the tests that helped us identify these significant changes.