了解 Flutter 3.16 功能更新
Flutter 休闲游戏工具包重大更新 https://medium.com/flutter/building-your-next-casual-game-with-flutter-716ef457e440
Material 3 成为新的默认设计语言
#130764 https://github.com/flutter/flutter/pull/130764
NavigationBar https://api.flutter.dev/flutter/material/NavigationBar-class.html Material 3 umbrella issue https://github.com/flutter/flutter/issues/91605
演示应用 https://flutter.github.io/samples/material_3.html
ThemeData.segmentedButtonTheme https://api.flutter.dev/flutter/material/SegmentedButtonThemeData-class.html ThemeData.snackBarTheme https://api.flutter.dev/flutter/material/SnackBarThemeData-class.html
支持 Material 3 动效
#129942 https://github.com/flutter/flutter/pull/129942
在编辑菜单中添加其他选项
用于指定全局文本缩放系数的 TextScaler
非线性字体缩放功能 https://blog.google/products/android/android-14/#:~:text=Also%2C%20you%20can%20improve%20readability,rate%20than%20smaller%20font%20size. TextScaler https://api.flutter.dev/flutter/painting/TextScaler-class.html #128522 https://github.com/flutter/flutter/pull/128522
SelectionArea 更新
Flutter 的 SelectionArea 经过更新,可支持与使用鼠标单击或双击以及触屏设备上长按相关的原生手势。您可以在默认情况下通过 SelectionArea 和 SelectableRegion 使用这些新手势:
单击: 在点击位置设置折叠的选项。 双击: 选择点击位置的字词。 双击 + 拖动: 扩展所选词块。
长按 + 拖动: 扩展所选词块。
可在焦点 widget 上操作的菜单项
#130536 https://github.com/flutter/flutter/pull/130536
iOS、macOS 中菜单项快捷方式的
自动重新排序
#129309 https://github.com/flutter/flutter/pull/129309
MatrixTransition 动画
DartPad 中示例 https://dartpad.dev/?channel=beta&id=c82be58209035722f2cc7d78da855329 #131084 https://github.com/flutter/flutter/pull/131084
PaintPattern 已添加到 flutter_test
expect(
find.byType(MyWidget),
paints
..circle(
x: 10,
y: 10,
radius: 20,
color: const Color(0xFFF44336),
),
);
// Multiple paint calls can even be chained together.
expect(
find.byType(MyWidget),
paints
..circle(
x: 10,
y: 10,
radius: 20,
color: const Color(0xFFF44336),
),
..image(
image: MyImage,
x: 20,
y: 20,
),
);
滚动更新
最新一集的《Flutter Build Show》 https://www.youtube.com/watch?v=ppEdTo-VGcg
two_dimensional_scrollables https://pub.flutter-io.cn/packages/two_dimensional_scrollables
Impeller
<meta-data
android:name="io.flutter.embedding.android.EnableImpeller"
android:value="true" />
Impeller repo docs https://github.com/flutter/engine/blob/main/impeller/docs/android.md#rendering-backend-selection 检查是否支持 Vulkan https://docs.vulkan.org/guide/latest/checking_for_support.html#_android
虽然迄今为止,我们对在 Impeller 的 Vulkan 后端上取得的进展比较满意,但预览阶段仍有一些已知问题:
由于平台视图尚未实现,因此包含平台视图的框架效果不佳。 自定义着色器尚未实现。 有关已知错误和缺失功能的完整列表,您可以参阅 GitHub 的 Impeller 项目板中的最新信息。我们已在 3.17 beta 版中修复了一些问题,您也可以试用新版本。
已知错误 https://github.com/orgs/flutter/projects/21/views/1?filterQuery=-status:%22%E2%9C%85+Done%22+status:%22%F0%9F%90%9E+Bugs%22 缺失功能 https://github.com/orgs/flutter/projects/21/views/11 项目板 https://github.com/orgs/flutter/projects/21
Impeller 性能、保真度和稳定性
引擎性能
修改了引擎 https://github.com/flutter/engine/pull/45673
API 和保真度改善
性能叠加 https://docs.flutter.dev/perf/ui-performance#the-performance-overlay 性能叠加将会正确显示 https://github.com/flutter/engine/pull/45259
Flutter 的弃用策略 https://docs.flutter.dev/release/compatibility-policy#deprecation-policy 重大变更页面 https://docs.flutter.dev/release/breaking-changes/paint-enableDithering
Flutter 游戏工具包
Trivia Crack https://triviacrack.com/ 4 Pics 1 Word https://flutter.cn/showcase/lotum Brick Mania https://play.google.com/store/apps/details?id=net.countrymania.brick&hl=en StopotS https://play.google.com/store/apps/details?id=com.gartic.StopotS&hl=en retro pinball game https://pinball.flutter.dev/ PUBG https://flutter.dev/showcase/pubg-mobile
休闲游戏工具包 http://flutter.cn
Chrome DevTools 中的
Flutter 时间轴事件
#130132
https://github.com/flutter/flutter/issues/130132
Web 应用的调试性能
https://docs.flutter.dev/perf/web-performance
鼠标滚轮支持
优化 Wonderous 以满足 Android 的大屏指南要求
https://medium.com/flutter/developing-flutter-apps-for-large-screens-53b7b0e17f10
普遍现象
https://github.com/flutter/flutter/issues/82973
44724
https://github.com/flutter/engine/pull/44724
预测性返回导航
迁移指南
https://docs.flutter.dev/release/breaking-changes/android-predictive-back#migration-guide
应用扩展
iOS 应用扩展
https://developer.apple.com/app-extensions/
添加 iOS 应用扩展
https://docs.flutter.dev/platform-integration/ios/app-extensions
新的 Flutter Favorite 内容
Flutter Favorite
https://docs.flutter.dev/packages-and-plugins/favorites
flame
https://pub.flutter-io.cn/packages/flame
flutter_animate
https://pub.flutter-io.cn/packages/flutter_animate
flutter_rust_bridge
https://pub.flutter-io.cn/packages/flutter_rust_bridge
riverpod
https://pub.flutter-io.cn/packages/riverpod
video_player
https://pub.flutter-io.cn/packages/video_player
macos_ui
https://pub.flutter-io.cn/packages/macos_ui
fpdart
https://pub.flutter-io.cn/packages/fpdart
首届 package 生态系统网络峰会
pub.dev
https://pub.dev/
基于 Cloud 的 Google 地图样式
GoogleMap(
onMapCreated: _onMapCreated,
initialCameraPosition: const CameraPosition(
target: _kMapCenter,
zoom: 7.0,
),
key: _key,
cloudMapId: _mapId
);
CameraX 改进
CameraX
https://developer.android.google.cn/training/camerax
Dependencies:
camera: ^0.10.4 # Or try the latest camera version
camera_android_camerax: ^0.5.0
macOS 视频播放器
视频播放器插件
https://pub.flutter-io.cn/packages/video_player
pub.dev
https://pub.dev/
视频播放器插件
https://pub.flutter-io.cn/packages/video_player
DevTools 扩展
新的 DevTools 扩展框架支持:
package 作者可以直接在 DevTools 中为 package 构建自定义工具。 package 作者可以利用 DevTools 中的现有框架和实用程序编写功能强大的工具。 正在使用 DevTools 调试应用的 Dart 和 Flutter 开发者可以访问特定于其用例的工具 (取决于其应用的依赖项以及哪些依赖项提供 DevTools 扩展)。
DevTools 扩展框架
https://pub.flutter-io.cn/packages/devtools_extensions
Provider
https://pub.flutter-io.cn/packages/provider
Drift
https://pub.flutter-io.cn/packages/drift
Patrol
https://pub.flutter-io.cn/packages/patrol
Provider
Patrol
Drift
Kenzie Davisson
https://medium.com/@kenzieschmoll
Dart 和 Flutter DevTools 扩展公告
https://medium.com/flutter/dart-flutter-devtools-extensions-c8bc1aaf8e5f
DevTools 更新
添加了对 DevTools 扩展的支持 添加了新的 "主" 屏幕,显示已连接应用的摘要
其他改进包括:
整体性能 热重启的稳健性 文本选择及复制行为 网络性能分析器响应查看器的优化
2.26.1
https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.26.1
2.27.0
https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.27.0
2.28.1
https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.28.1
VS Code 界面可检测性
感谢 Flutter 社区成员 DanTup 的出色工作, Flutter VS Code 扩展现已配备 Flutter 侧边栏,您可以轻松:
打开 Flutter DevTools 屏幕 查看处于活跃状态的调试会话 查看可用设备 创建新项目 热重载和重启 运行 Flutter Doctor -v
DanTup
https://github.com/DanTup
此版本的弃用指南
https://docs.flutter.dev/release/breaking-changes/3-13-deprecations
Flutter Fix
https://docs.flutter.dev/development/tools/flutter-fix
提供测试
https://github.com/flutter/tests/blob/master/README.md
Flutter 的重大变更政策
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
版本说明和更新日志
https://docs.flutter.dev/release/release-notes
Dart 3.2
https://medium.com/dartlang/dart-3-2-c8de8fe1b91f
flutter upgrade
https://docs.flutter.dev/release/upgrade