本次 Flutter 3.0 主要包括 macOS 和 Linux 的稳定版发布,以及相关的性能改进等。原文链接 medium.com/flutter/wha…
This Flutter 3.0 mainly includes the steady editions of MacOS and Linux, and associated performance improvements. The original link medium.com/Flutter/wha
又到了发布 Flutter 稳定版本的时候,在三个月前我们发布了 Flutter 关于 Windows 的稳定版,而今天,除 Windows 之外,Flutter 也正式支持 macOS 和 Linux 上的稳定运行。
At the time of the release of the Flutter stabilization version, three months ago, we released the Flutter stabilization version of Windows, and today, in addition to Windows, Flutter officially supports stable operations on macos and Linux .
在这里感谢所有 Flutter contributors 的辛勤工作,本次版本发布合并了 5248 个 PR。
Thank you all for your hard work here. The release of this version combines 5248 PR.
Flutter 3.0 的发布,主要包括 Flutter 对 macOS 和 Linux 正式版支持、进一步的性能改进、手机端和 Web 端相关的更新等等。此外还有关于减少对旧版本 Windows 的支持,以及一些 breaking changes 列表。
Linux 和 macOS 已达进入稳定版本阶段,包括以下功能:
Linux and macos have reached the stabilization phase and include the following functions:
现在可以使用 在 macOS 上创建菜单栏,该 Widget 支持仅插入平台菜单,并控制 macOS 菜单中显示的内容。
You can now use the menu bar created on macos that Widget supports inserting only the platform menu and controls what is displayed in the macos menu.
包括使用input method editors(IME),如中文、日文和韩文,在 Flutter 3.0 上所有桌面平台上都得到支持,包括第三方输入法如搜狗和谷歌日文输入法。
Including the use of input methods(IME), such as Chinese, Japanese and Korean, is supported on all desktop platforms on Flutter 3.0, including third-party input laws such as dog search and Google day entry laws.
Flutter for Windows、macOS 和 Linux 全面支持 Accessibility 服务,例如屏幕阅读、无障碍导航和倒置颜色等。
Flutter for Windows, macos and Linux fully supports Accessbility services such as screen reading, accessible navigation and inverted colours.
从 Flutter 3 开始,Flutter macOS 桌面应用都将被构建为 universal binaries,从而支持现有的基于 Intel 处理器的 Mac, 和 Apple 的 Apple Silicon 设备。
Starting with Flutter 3, the Flotter macos desktop applications will be constructed as universal binaries, thereby supporting the existing Intel processor-based Mac and Apple-based Apple Silicon devices.
在 Flutter 3.0 中,推荐将 Windows 的版本提升到 Windows 10,虽然目前 Flutter 团队不会阻止在旧版本(Windows 7、Windows 8、Windows 8.1)上进行开发,但 Microsoft 不再支持 这些版本,虽然 Flutter 团队将继续为旧版本提供“尽力而为”的支持,但还是鼓励开发者升级。
In Flutter 3.0, it is recommended that the Windows version be upgraded to Windows10, although currently the Flutter team will not prevent development on the old versions (Windows 7, Windows 8, Windows 8.1, but versions, although the Flutter team will continue to provide “support for the development of the old version, but encourage the development of the old version “ref's'ref'nof'nofolowernoformernerrepré"
注意:目前还会继续为在 Windows 7 和 Windows 8 上能够正常运行 Flutter 提供支持;此更改仅影响开发环境。
Note : Support will continue to be provided to enable Flutter to run normally on Windows 7 and Windows 8; this change will affect the development environment only.
对移动端的更新包括以下内容:
Updates to the mobile end include the following:
Flutter 3 版本开始支持可折叠的移动设备。在 Microsoft 发起的合作中,新功能和 Widget 可让开发者在可折叠设备上拥有更舒适的体验。
The Flotter 3 version starts to support foldable mobile devices. In Microsoft-initiated collaboration, new features and Widget allow developers to have a more comfortable experience of foldable devices.
其中包括 现在包含一个 列表,用于描述设备的边界和状态,如铰链、折叠和切口等。此外 现在可以通过定位其子 Widget 的位置不会与 的边界重叠,并且目前已经与 framework 的默认对话框和弹出窗口集成,使得 Flutter 能够立即感知和响应这些元素。
includes a list that now contains a description of the boundary and state of the device such as a chain, folding and incision. In addition, the location of its son Widget does not overlap with the boundary and is now integrated with the default dialogue box and popup window of the framework, enabling Flutter to immediately sense and respond to these .
这里非常感谢 Microsoft 团队,尤其是@andreidiaconu,感谢他们的 contributions!另外可以试用一下Surface Duo 模拟器示例,它包括一个带有 Flutter Gallery 特殊分支的示例,可以用于了解 Flutter 在折叠屏中的实际应用。
Thank you very much to the Microsoft team, in particular @andreidiconu, thanks to their contentions!
Flutter 现在支持 iOS 上的 ProMotion 刷新率,包括 iPhone 13 Pro 和 iPad Pro 等。
Flutter now supports the ProMotion refresher rate on iOS, including iPhone 13 Pro and iPad Pro et al. .
在这些设备上,Flutter 可以以达到 120 hz的刷新率进行渲染,再次之前 iOS 上的刷新率限制为 60hz,有关更多详细信息,请参阅flutter.dev/go/variable…。
On these devices, Flutter can be rendered with a refresher rate of 120 hz, which is limited to 60hz again before iOS, for more detailed information, see flutter.dev/go/variable.
Flutter 团队 为 flutter build ipa 命令添加了新选项支持以简化发布 iOS 应用。
to support simplified issuance of iOS applications.
当开发者准备好分发到 TestFlight 或 App Store 时,可以通过运行 以构建 Xcode 存档(文件)和应用程序包(文件)。 这时候可以选择添加 、 或 来定制发布支持。
When the developers are ready to distribute to TestFlight or App Store, they can build an Xcode archive (file) and application packages (files). This time you can choose to add or customize publishing support.
构建应用程序包后,可以通过 Apple Transport macOS 应用或在命令行上使用 (运行 用于 App Store Connect API 的密钥身份验证)将其上传到 Apple 。上传后,应用就可以可发布到TestFlight 或 App Store。
通过这个简化流程,在设置初始的Xcode 项目设置后,例如名称和应用图标,开发者可以不再需要打开 Xcode 来发布 iOS 应用。
Through this simplified process,
现在使用 Flutter 工具创建新项目,会发现生现在开始使用最新版本的 Gradle 和 Android Gradle Plugin,对于现有项目,需要手动将版本升级到 Gradle 的 7.4 和 Android Gradle 插件的 7.1.2。
To create new projects now using the Flutter tool, it will be found that the latest versions of Gradle and Android Gradle Plugin are now being used. For existing items, it will be necessary to manually upgrade versions to 7.4 of Gradle and 7.1.2 of Android Gradle plugins.
正如 2022 年 2 月发布的 2.10 稳定版本时所说的那样,Flutter 对 32 位 iOS 设备以及 iOS 9 和 10 版本的支持即将结束。此更改影响 iPhone 4S、iPhone 5、iPhone 5C 以及第 2、3 和 4 代 iPad 设备。Flutter 3 是它们最后一个支持 iOS 版本支持。
As was stated in February 2022 in the stabilization version 2.10, Flutter’s support for 32-bit iOS devices and iOS 9 and 10 versions is coming to an end. This change affects iPhone 4S, iPhone 5, iPhone 5C, and iPad devices of generation 2, 3 and 4. Flutter 3 is their last support for iOS versions.
要了解有关此更改的更多信息,请查看RFC:End of support for 32-bit iOS devices。
For more information on this change, please see RFC: End of support for 32-bit iOS devices.
Web 应用更新包括以下内容:
The Web application update includes the following:
Flutter web 现在会在支持它的浏览器中自动检测和使用 ImageDecoder API,而截至今天大多数基于 Chromium 的浏览器(Chrome、Edge、Opera、三星浏览器等)都添加了此 API。
Flotter web now automatically detects and uses ImageDecoder API in the browser that supports it, and as of today most Chromium-based browsers (Chrome, Edge, Opa, Tristar browsers, etc.) add this API.
新的 API 使用浏览器的内置图像编解码器从主线程异步解码图像,这将图像解码速度提高了 2 倍,并且它从不阻塞主线程,从而消除了以前由图像引起的所有卡顿问题。
's new API uses a built-in image codecer from the main thread asymptoms image, which increases the speed at which the image is decoded by two times and does not block the main thread, thus eliminating all previously image-induced Caden problems .
Flutter Web 应用程序的新生命周期 API 使开发者可以更灵活地从托管 HTML 页面控制 Flutter 应用的引导过程,并帮助 Lighthouse 分析应用的性能,包括以下经常请求的场景:
The new life cycle of the Flotter Web application API allows developers more flexibility to control the orientation of the Flutter application from hosting HTML pages and helps Lighthouse analyse the performance of the application, including the following frequently requested scenes:
- 启动画面。
- 加载指示器。
- 在 Flutter 应用程序之前显示的纯 HTML 交互式登录页面。
有关更多信息,请查看docs.flutter.dev 上的自定义 Web 应用程序初始化。
For more information, please see .
Flutter 和 Dart 工具的更新包括:
Updates to Flutter and Dart tools include:
lint 包的 2.0 版已发布:
Lint package version 2.0 has been released:
- Flutter:https ://pub.dev/packages/flutter_lints/versions/2.0.0
- Dart:https ://pub.dev/packages/lints/versions/2.0.0
在 Flutter 3 中生成的应用程序会通过 自动启用 v2.0 的 lints 集。Flutter 现在鼓励现有的应用、包和插件都迁移到 v2.0 以遵循该协议,迁移支持可以通过运行 .
Applications generated by in Flutter 3 will be automatically enabled with the lints set of v2.0 strong >. Flutter now encourages existing applications, packages and plugins to migrate to v2.0 to comply with this agreement, and the migration support can be run.
v2 中大多数新添加的 lint 警告都带有自动修复功能。因此在 文件中升级到最新的包版本后,可以运行 自动修复大多数 lint 警告(可能一些警告仍然需要一些手动工作。
Most of the newly added Lint warnings in
尚未使用 的应用、软件包或插件可以按照迁移指南进行迁移。
Applications, packages or plugins that are not yet in use can be relocated according to .
感谢 contributor knopp,局部重绘的支持已在 Android 设备上启用。
Thanks to the confrator , , the support of
在本地测试中,此更改将Pixel 4 XL 设备在 基准测试上, 90th percentile 和 99th 的帧光栅化时间减少了 5 倍,现在在 iOS 和基础此更新的 Android 设备上都启用了,当存在单个矩形脏区域时的部分重绘支持。
In local tests, this change reduces 90th percentile and 99th's frame-fence time by five times over the Pixel 4XL device on the baseline test, and is now enabled on iOS and the base of this updated Android device, which is partially re-painted to support
另外,Flutter 3.0 还进一步改进了不透明动画相关的性能,特别是当一个 Widget 只包含一个渲染 primitive 时, 下关于 的调用通常会被省略。在基准测试下中,这种情况下的光栅化时间提高了一个数量级,在未来的版本中,我们计划将此优化应用于更多场景。 In addition,
再次感谢 contributor JsouLiang 的提交,现在引擎的光栅和 UI 线程在 Android 和 iOS 上运行的优先级高于其他线程,例如 Dart VM 后台垃圾回收线程,而在我们的基准测试中,这导致平均框架构建时间加快了约 20%。 & thanked , submitted by 在 Flutter 3.0 之前,光栅缓存的准入策略仅查看图片中绘制操作的数量,不幸的是这会导致引擎花费更多的内存,来缓存实际上渲染速度非常快的图片。新版本引入了一种机制,该机制会根据其图片绘制操作的成本来估计图片的渲染复杂性,将其用作光栅缓存准入策略从而减少内存使用量,并且不会在我们的基准测试中降低性能。 Before Flutter 3.0, the raspberry buffer access strategy looked only at the number of operations drawn in the picture, which unfortunately led to the engine spending more memory than it actually did. The new version
感谢 contributor ColdPaleLight,他修复了帧调度 中的一个错误,该错误导致 iOS 上的少量动画帧被丢弃的问题。 Thanks to the confirator ColdPaleLight, he repaired one of the errors on , he dropped an error from 团队一直在努力寻找解决 iOS 和其他平台上卡顿的解决方案。在 Flutter 3 版本中可以在 iOS 上preview 一个名为Impeller 的实验性渲染工具,Impeller 在引擎构建时会预编译一组更小、更简单的着色器,这样它们就不会在应用程序运行时编译,这一直是 Flutter 中卡顿的主要来源。 The team has been trying to find solutions for katon on iOS and other platforms. Impeller 尚未准备好正式发布,目前还远未到完成阶段,所以并非所有 Flutter 功能都能实现,但我们对它在 Flutter?/gallery 应用程序中的保真度和性能感到非常满意,特别是 Gallery 应用里过渡动画中最差的帧快了大约 20 倍。 Impeler is not yet ready to be officially released, and not all Flutter is yet to be completed, but we are very satisfied with its authenticity and performance in the application: "https://link.juejin.cn?target=https%3A%2Fgithub.com2Fflutter%2Fgalery" target="blank" title=https://glithub.com/flutter/gallery"ref_nollemrer=2; "galler Impeller 可以在 iOS 上通过启动 tag 来启动,开发者可以传递 到 或将 文件中的 标志设置为 来尝试 Impeller。 使用 时,开发者应该会在用户关键交互(例如页面之间的滚动和转换)中得到更好的性能。 When used, the developer should gain better performance in key user interactions (e.g. rolling and switching between pages). 在底层,Flutter 现在使用新的异步组合来实现 Android 视图,它们通常称为platform views。这意味着 Flutter 光栅线程不再需要等待 Android 视图渲染。相反,Flutter 引擎会使用它管理的 OpenGL 纹理将视图放置在屏幕上。 At the bottom of the floor, Flutter now uses a new angular combination to achieve the Android view, commonly known as platformviews. This means that the flotter circuit process no longer needs to wait for the Android view. Flutter 生态系统的其他更新包括: Other ecosystem updates include: Flutter 3 支持Material Design 3,即下一代 Material Design。 Flutter 3 为 Material 3 提供了更多可选支持,包括 Material You 功能如:动态颜色,新的颜色系统和排版、组件的更新以及 Android 12 中引入的新视觉效果,如新的触摸波纹设计和拉伸过度滚动效果。 Flutter 3 provides more optional support for Material 3 including: dynamic colours, new colour systems and layouts, updates of components and new visual effects introduced in Android 12, such as new tactile bead designs and over-rolling effects . 开发者可以在 codelab 的?Take your Flutter app from Boring to Beautiful? 中尝试 Material 3 功能,有关如何选择加入这些新功能,以及哪些组件支持 Material 3 的详细信息,请参阅API 文档。 Flutter 现在可以使用名为 Theme extensions 的概念向 Material 的 添加任何内容,开发者可以通过 .extensions 去添加自己想要的内容,而不是(在 Dart 意义上)继承 并重新实现其、和其他方法。 Flutter can now add anything to Material using a concept called Theme exitions, and developers can add what they want through.extensions, instead of inheriting and re-exercise (in the sense of Dart) and other ways. 此外,作为 package 开发人员,你可以提供 相关内容,有关此内容的更多详细信息,请参阅flutter.dev/go/theme-ex… 和 GitHub 上 的示例。 In addition, as a package developer, you can provide more detailed information on the content, which can be found at fluter.dev/go/thehuman"ft"ftlälälätlätlälälätlälätlätlätlätlätlätlälätlätlätlätlälätlätlätlälätlätlälätlätlätl_k_k_k_lälätlätlätlätlätlätlätlätl_ /ft_lätlätlätlätl_ /flätlätlätl_ 对于发布商而言,个性化广告征求同意并处理 Apple 的 App Tracking Transparency (ATT) 非常重要。 For publishers, individualized advertising is important to obtain consent and deal with Apple's App Trading Transparency (ATT). 为了支持这些要求,Google 提供了用户消息传递平台 (UMP) SDK,它取代了之前的开源 Consent SDK,在即将发布的 GMA SDK for Flutter 中,我们将添加对 UMP SDK 的支持,以帮助发布者获得用户同意。 In support of these requests, Google provided the User Message Transfer Platform (UMP) SDK, which replaced the previous open source , which will be published shortly, we will add support for UPPSDK to help publishers obtain user consent. 有关更多详细信息,请查看 pub.dev 上的google_mobile_ads页面。 For more detailed information, please refer to google_mobile_ads. 随着 Flutter 的不断改进 ,我们的目标是尽量减少重大更改的数量,而随着 Flutter 3 的发布,Flutter 有以下重大变化: As Flutter continues to improve, our goal is to minimize the number of significant changes, and with the release of Flutter 3, Flutter has the following major changes: 如果你正在使用这些 API,请参阅Flutter.dev 上的迁移指南。 If you are using these APIs, please refer to Flutter.dev
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论