如何在pubspec.yaml中指定dependency_overrides?

时间:2014-04-12 14:02:17

标签: dart angular-dart

我正在使用最新版本的angular.dart,我的pubspec.yaml看起来有点像这样:

name: angularApp
dependencies:
  angular:
    git:  'git@github.com:angular/angular.dart'
  third_party_angular_plugin: any

问题是third_party_angular_plugin取决于angular.dart的稳定版本。我试着指定如下:

name: angularApp
dependencies:
  angular:
    git:  'git@github.com:angular/angular.dart'
  third_party_angular_plugin: any
dependency_overrides:
  angular:
    version: ">=0.9.10"

但它引发了一个奇怪的错误Bad State: No elements dart:core List.single ....

如何覆盖third_party_angular_plugin对我应用的角度的依赖性?

1 个答案:

答案 0 :(得分:1)

version不是单独的嵌套密钥,根据Pub Dependencies页面上的示例,正​​确的格式为:

name: angularApp
dependencies:
  angular:
    git:  'git@github.com:angular/angular.dart'
  third_party_angular_plugin: any
dependency_overrides:
  angular: ">=0.9.10"