visual-studio - pubspec.yaml 第 17 行第 5 列错误 : A dependency may only have one source

标签 visual-studio dart flutter

在 pubspec 文件中添加了 http 包并得到错误:A dependency may only have one source,如下图所示。

enter image description here

请帮我解决这个问题。

谢谢。

最佳答案

缩进在 YAML 中很重要

应该是

dpendencies:
  flutter:
    sdk: flutter
  http: ^0.12.0+^ # indentation like `flutter:` above, not like `sdk: ...`

关于visual-studio - pubspec.yaml 第 17 行第 5 列错误 : A dependency may only have one source,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54762738/

相关文章:

c# - 如何从 UWP TimePicker 中删除按钮

visual-studio - SSIS OData 源在 Visual Studio 2017 中工作,但在 Azure 数据工厂中运行时失败

flutter - 为什么 return 语句在这个 dart 程序中不起作用?

flutter - 多图像上传导致应用程序崩溃说太多打开的文件

json - Flutter Dart http Type Response不是字符串错误的子类型

flutter |右对齐不起作用

visual-studio - Visual Studio宏: Find files that aren't included in the project?

c# - Jetbrains Rider在Visual Studio调试器中是否有类似View反汇编代码的功能

keyboard - 如何在 Dart 游戏中重复听按键?

flutter - 当我尝试将 APK 构建为发布版本时,我遇到了灰屏,Flutter 中没有任何内容