Flutter 3.3 is officially released
Original link : https://medium.com/flutter/whats-new-in-flutter-3-3-893c7b9af1ff
Flutter 3.3 is officially released. This update brings related updates such as Flutter Web, desktop, and text performance processing.go_router
, DevTools and VS Code extensions introduce more updates .
Framework
Global Selection
In previous versions of Flutter Web, it was common to have text selections that didn't match the expected behavior, because like Flutter Apps, native Web consisted of a tree of elements.
In traditional web applications, developers can select multiple web elements with a single drag gesture, but this cannot be done easily on Flutter Web.
But since 3.3, withSelectableArea
the introduction ofSelectableArea
Any Child of the Widget can freely enable the modification ability .
To take advantage of this powerful new feature, simply useSelectionArea
Nest your pages, such as under the routeScaffold
, and let Flutter do the rest.
For a fuller in-depth look at this new feature, visit
SelectableArea
API
touchpad input
Flutter 3.3 has improved support for touchpad input , which not only provides richer and smoother control logic, but also reduces false recognition in some cases.
As an example, drag a UI element page in the Flutter cookbook, scroll to the bottom of the page, and perform the following steps :
-
- Shrink the window size so that scrollbars appear on the upper part
-
- hover over
-
- Scroll with the trackpad
-
- Prior to Flutter 3.3, scrolling on a trackpad would drag items because Flutter was dispatching simulated generic events
-
- After Flutter 3.3, scrolling on the trackpad will scroll the list correctly, because Flutter provides "scroll" gestures, cards are not recognized, but scrolling is recognized.
For more information, see the Flutter Trackpad Gestures design documentation, and the following PR on GitHub:
- PR 89944: Support trackpad gestures in frames
- PR 31591: iPad trackpad gestures
- PR 34060: "ChromeOS/Android Trackpad Gestures"
- PR 31594: Win32 trackpad gestures
- PR 31592: Linux trackpad gestures
- PR 31593: Mac Trackpad GesturesmacOS
Scribble
Thanks to the contributions of community member fbcouch , Flutter now supports Scribble handwriting input with Apple Pencil on iPadOS .
By default, this function isCupertinoTextField
,TextField
andEditableText
To enable this feature, just upgrade to Flutter 3.3 .
Text input
To improve support for rich text editing, this release introduces the platform'sTextInputPlugin
, before,TextInputClient
deliver only the new edit state, no diff information between old and new, andTextEditingDeltas
filledDeltaTextInputClient
This information is blank .
With access to these increments, developers can build an input field with a styled range that expands and contracts as the user types.
To learn more, check out the rich text editor demo .
Material Design 3
The Flutter team continues to migrate more Material Design 3 components to Flutter. This release includesIconButton
,Chips
as well asAppBar
.
To monitor the progress of the Material Design 3 migration, check out Bringing Material 3 to Flutter on GitHub .
icon button
Chip
Medium and large AppBar
Desktop
Windows
Previously, Windows' versions were set by Windows app-specific files, but this behavior was inconsistent with how other platforms set their versions.
But now developers canpubspec.yaml
Set the Windows desktop application version in files and build parameters .
For more information on setting the app version, please follow the documentation and migration docs.flutter.dev
Packages
go_router
To extend Flutter's native navigation API, the team released a new version ofgo_router
package, which is designed to make routing logic easier for mobile, desktop, and web.
go router
The package, maintained by the Flutter team, simplifies routing by providing a declarative, url-based API for easier navigation and handling of deep links.
The latest version (5.0) enables apps to redirect using asynchronous code and includes other breaking changes described in the migration guide . For more information, check out the Navigation and Routing page on docs.flutter.dev.
VS Code extension enhancements
The Visual Studio Code extension for Flutter has several updates, including improvements to adding dependencies, developers can now add multiple comma-separated dependencies in one step using Dart: Add Dependency.
Flutter Developer Tools Update
DevTools has had many updates since the last stable Flutter release, including UX and performance improvements to the data display table for faster and less scrolling of large event lists ( #4175 ).
For the full list of updates since Flutter 3.0, check out the individual announcements here:
- Flutter DevTools 2.16.0 Release Notes
- Flutter DevTools 2.15.0 Release Notes
- Flutter DevTools 2.14.0 Release Notes
Performance
Raster cache improvements
This release improves the performance of loading images from assets by eliminating copies and reducing Dart garbage collection (GC) pressure .
Previously when loading an asset image,ImageProvider
The API needs to copy the compressed data multiple times, when the assets are opened and exposed to Dart as a typed data array, it is copied to the native heap, and then when the typed data array is copied to the internal by it a second timeui.ImmutableBuffer
.
Via #32999 , compressed image bytes can be loaded directly intoui.ImmutableBuffer.fromAsset
In the structure used for decoding, this method needs to be changedImageProviders
, the process is also faster, as it bypasses some of the additional scheduling overhead required by the channel-based loader of previous methods, especially in our microbenchmarks, which improves image loading time by a factor of nearly 2 .
See ImageProvider.loadBuffer on docs.flutter.dev for more information and migration guidance.
Stability
iOS pointer compression is disabled
In the 2.10 stable release, we enabled Dart's pointer compression optimizations on iOS , however Yeatse on GitHub reminded us that the optimizations didn't turn out well.
Dart's pointer compression works by reserving a large virtual memory area for Dart's heap. Since the total virtual memory allocation allowed on iOS is less than other platforms, this large reservation reduces the amount of space available for other components to reserve their own memory Amount of memory used, such as Flutter plugins.
While disabling pointer compression will increase the memory consumed by Dart objects, it also increases the available memory for non-Dart parts of your Flutter application, which is an overall more desirable direction .
Apple provides an entitlement to increase the maximum virtual memory allocation allowed by an application, but this entitlement is only supported on newer iOS versions, and currently does not apply to devices running iOS versions that are still supported by Flutter.
API improvements
PlatformDispatcher.onError
In previous versions, developers had to manually configure customizationsZone
item to catch all exceptions and errors of the application, but customZone
Some optimizations in the Dart core library are detrimental, which can slow down application startup times.
In this release, instead of using custom, developers can catch all errors and exceptions by setting callbacks.
For more information, check out the updated PlatformDispatcher.onError in the Flutter page on docs.flutter.dev
FragmentProgram changes
written in GLSL andshaders:
Fragment shaders listed in the Flutter manifest of the app file,pubspec.yaml
Will now be automatically compiled into the correct format the engine understands and bundled with the app as assets.
With this change, developers will no longer need to use third-party tools to manually compile shaders. In the future, the Engine'sFragmentProgram
The API is considered to only accept output from the Flutter build tool, which of course is not currently the case, but this change is planned for a future release, as described in the FragmentProgram API Support Improvements Design document.
See this Flutter shader example for an example of this change .
Fractional translation
Previously, the Flutter Engine always aligned composited layers to precise pixel boundaries because it improved rendering performance on older (32-bit) iPhones.
Since adding desktop support, we've noticed that this results in observable snapping behavior as screen devices are much lower in pixels than usual, e.g. on low DPR screens one can see tooltips snapping noticeably when fading in.
#103909 removed this pixel-snapping from the Flutter engine to improve desktop fidelity after it was determined that this pixel-snapping was no longer necessary for the performance of new iPhone models .
Additionally, we've found that removing this pixel snap stabilizes some of our golden image tests, which often change with subtle fine-line rendering differences.
Changes to Supported Platforms
32-bit iOS deprecated
As we previously announced in version 3.0, this version is the last to support 32-bit iOS devices and iOS versions 9 and 10 due to reduced usage .
This change affects iPhone 4S, iPhone 5, iPhone 5C, and 2nd, 3d, and 4th generation iPad devices.
The Flutter 3.3 stable release and all subsequent stable releases no longer support 32-bit iOS devices and iOS 9 and 10 versions, which means that apps built on Flutter 3.3 and later will not run on these devices.
Disable macOS 10.11 and 10.12
In the Q4 2022 stable release, we expect to drop support for macOS versions 10.11 and 10.12.
This means that apps built against the stable Flutter SDK after that will no longer run on these versions, and the minimum macOS version supported by Flutter will increase to 10.13 High Sierra.
Bitcode deprecation
In the upcoming Xcode 14 release, iOS app submissions will no longer accept Bitcode, and bitcode-enabled projects will issue build warnings in this version of Xcode. Due to this, Flutter will drop support for bitcode in a future stable release.
Flutter apps don't have Bitcode enabled by default, and we don't expect this to affect many developers.
However, if you manually enabled bitcode in your Xcode project, disable it immediately after upgrading to Xcode 14, which can be done by turning onios/Runner.xcworkspace
To do this, build settings Enable Bitcode and set it to No , Add-to-app developers should disable it in the host Xcode project.