我已经切换到频道主机并运行dart --version给我:
代码块1
Dart SDK version: 3.0.0-178.0.dev (dev) (Fri Jan 27 17:53:41 2023 -0800) on "macos_arm64"
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用新的记录语法时,我得到以下信息:
代码块2
This requires the 'records' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 3.0.0 or higher, and running 'pub get'.
Run Code Online (Sandbox Code Playgroud)
我尝试将 pubspec 中的 sdk 版本值更改为,^3.0.0,但我得到以下信息:
代码块3
Resolving dependencies...
The current Dart SDK version is 3.0.0-178.0.dev.
Because app requires SDK version 3.0.0, version solving failed. exit code 1
Run Code Online (Sandbox Code Playgroud)
如果我尝试将版本设置为特定的,3.0.0-178.0.dev那么我会从代码块 2 中收到错误,即:
This requires the 'records' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 3.0.0 or higher, and running 'pub get'.
Run Code Online (Sandbox Code Playgroud)
您可以按照以下步骤操作。
\n步骤1: 确保您位于主分支而不是稳定分支(当前)。flutter --version将显示类似此或更高版本的内容
Flutter 3.7.0-29.0.pre.21 \xe2\x80\xa2 channel master \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision 75680ae99e (5 hours ago) \xe2\x80\xa2 2023-01-28 08:54:06 -0500\nEngine \xe2\x80\xa2 revision 649362168f\nTools \xe2\x80\xa2 Dart 3.0.0 (build 3.0.0-179.0.dev) \xe2\x80\xa2 DevTools 2.20.1\nRun Code Online (Sandbox Code Playgroud)\n第 2 步:配置analyzsis_options.yaml
Flutter 3.7.0-29.0.pre.21 \xe2\x80\xa2 channel master \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision 75680ae99e (5 hours ago) \xe2\x80\xa2 2023-01-28 08:54:06 -0500\nEngine \xe2\x80\xa2 revision 649362168f\nTools \xe2\x80\xa2 Dart 3.0.0 (build 3.0.0-179.0.dev) \xe2\x80\xa2 DevTools 2.20.1\nRun Code Online (Sandbox Code Playgroud)\n您可以检查并克隆我的experimental_project存储库。
\n| 归档时间: |
|
| 查看次数: |
2502 次 |
| 最近记录: |