解决无法因为空安全无法正常点击运行和热重载
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
原因:新版flutter增加了空安全 详情内容 https://blog.csdn.net/BUG_delete/article/details/115076100
解决方案
- 回退fluttet版本 (不推荐)
- 1在 Android Studio 中:
运行 --> 编辑配置 --> 添加额外的运行参数 --> --no-sound-null-safety
2.2 VS code 解决方案
在项目根目录中创建 .vscode/launch.json 并添加
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "hollebug",
"request": "launch",
"type": "dart",
"args": [
"--no-sound-null-safety"
]
},
{
"name": "hollebug (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
]
}