Flutter 1.20 来啦!规模最大的版本发布都有哪些更新?
作者 / Chris Sells, Product Manager, Flutter developer experience
Visual Studio Code 的 Flutter 扩展 https://dartcode.org/
CareF https://github.com/CareF AyushBherwani1998 https://github.com/AyushBherwani1998 a14n https://github.com/a14n
2020 年开发语言排名榜单 https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2020
Flutter 和 Dart 的性能改进
修复进行图标字体摇树操作时的工具性能问题 https://github.com/flutter/flutter/pull/55417 默认进行字体摇树操作 https://github.com/flutter/flutter/pull/56633 应用大小缩减 100kb https://github.com/flutter/flutter/pull/49737
降低移动端着色器编译卡顿 https://flutter.cn/docs/perf/rendering/shader
重构鼠标点击测试系统 https://github.com/flutter/flutter/pull/59883
移动端文本字段自动填充
PR 52126 https://github.com/flutter/flutter/pull/52126
用于常见交互模式的全新 widget
此版本引入了一个新的 widget: InteractiveViewer。InteractiveViewer 旨在为您的应用构建常见交互,如平移、缩放和拖放,甚至在可调节大小的窗口中也可实现这些交互,请参见下面这个简单的围棋示例。
围棋示例 https://github.com/justinmc/flutter-go
InteractiveViewer widget https://api.flutter.cn/flutter/widgets/InteractiveViewer-class.html 介绍 InteractiveViewer https://www.youtube.com/watch?v=ChFa0A72Uto
知晓拖放操作的位置 https://github.com/monkeyswarm/DragTargetDetailsExample
Widget 更新:
Material Slider / RangeSlider / TimePicker / DatePicker
Material 设计指南 https://material.io/components/sliders Slider widget 的更新 https://medium.com/flutter/whats-new-with-the-slider-widget-ce48a22611a3
Time Picker 演示 https://flutter-time-picker.firebaseapp.com/#/
响应式许可页面
TonicArtos https://github.com/TonicArtos PR 57588 https://github.com/flutter/flutter/pull/57588
发布插件所需的新 pubspec.yaml 格式
新的 pubspec.yaml 格式 https://flutter.cn/docs/development/packages-and-plugins/developing-packages#plugin-platforms
功能预览: 在 Visual Studio Code 中嵌入 Dart DevTool
提交反馈 https://github.com/Dart-Code/Dart-Code/issues
网络监测功能更新
在文件重命名时更新导入语句
面向每个工具制造者的工具元数据
还有一项为 Flutter 工具开发者提供的更新。我们在 GitHub 上创建了一个新项目,来捕获和发布有关 Flutter 框架本身的元数据。它提供以下机器可读数据文件:
当前所有 Flutter widget 的目录 (有 395 个!)
https://github.com/flutter/tools_metadata/blob/master/resources/catalog/widgets.json Flutter 框架中颜色名称到颜色值的映射,支持 Material 和 Cupertino 颜色集
https://github.com/flutter/tools_metadata/tree/master/resources/colors Material 和 Cupertino 图标的图标元数据,包括图标名称和预览图标
https://github.com/flutter/tools_metadata/tree/master/resources/icons
dratushnyy https://github.com/dratushnyy
平台互操作的类型安全平台通道
Flutter 插件 https://flutter.cn/docs/development/packages-and-plugins/developing-packages 将 Flutter 集成到现有应用 https://flutter.cn/docs/development/add-to-app Pigeon https://pub.flutter-io.cn/packages/pigeon
video_player https://pub.flutter-io.cn/packages/video_player 平台通道 https://flutter.cn/docs/development/platform-integration/platform-channels#pigeon Add-to-App 示例 https://github.com/flutter/samples/tree/master/add_to_app/flutter_module_books
还有众多工具更新,不胜枚举
截至 Flutter 1.20 发布,众多工具的版本也全新亮相,我们无法在此列出所有内容,请查看它们的更新公告:
VS Code 扩展 v3.13 https://groups.google.com/g/flutter-announce/c/TlN12RemsYw VS Code 扩展 v3.12 https://groups.google.com/g/flutter-announce/c/8tSufvaRJUg VS Code 扩展 v3.11 https://groups.google.com/g/flutter-announce/c/gM0bqO7NFA0 Flutter IntelliJ 插件 M46 版 https://groups.google.com/g/flutter-announce/c/8C2v2ueXjts Flutter IntelliJ 插件 M47 版 https://groups.google.com/g/flutter-announce/c/6SF3PG_XB8g/m/6mAY7eC_AAAJ Flutter IntelliJ 插件 M48 版 https://groups.google.com/g/flutter-announce/c/i9NTk5o9rZQ 我们用 Flutter 写了一套全新的 Flutter 开发者工具
重要改动 (Breaking Changes)
55336: 将 tabSemanticsLabel 添加到 CupertinoLocalizations - 迁移指南 PR https://github.com/flutter/flutter/pull/55336
https://flutter.cn/docs/release/breaking-changes/cupertino-tab-bar-localizations 55977: 将 clipBehavior 添加至具有 clipRect 的 widget https://github.com/flutter/flutter/pull/55977
https://files.flutter-io.cn/sources/flutter-design-docs/Clip_Behavior.docx
55998: 为 Navigator 的 TransitionDelegate 新加入了 isWaitingForExitingDecision 判断
https://github.com/flutter/flutter/pull/55998
https://groups.google.com/forum/#!searchin/flutter-announce/55998%7Csort:date/flutter-announce/yoq2VGi94q8/8pTsRL28AQAJ 56582: 更新 Cupertino 中的 Tab 语义,使其与 Material 相同 https://github.com/flutter/flutter/pull/56582
https://flutter.cn/docs/release/breaking-changes/cupertino-tab-bar-localizations#migration-guide
57065: 移除 NestedScrollView 重叠管理条中被弃用的子参数
https://github.com/flutter/flutter/pull/57065
58392: 确保在 iOS 里的系统行为一致性,为 CupertinoActivityIndicator 加入 progress 参数
https://github.com/flutter/flutter/pull/58392
总结
健全的空安全 http://dart.cn/null-safety 了解空安全 https://dart.cn/null-safety/understanding-null-safety
推荐阅读