Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

dart - How to specify dependency_overrides in pubspec.yaml?

I am working with latest version of angular.dart and my pubspec.yaml looks somewhat like this:

name: angularApp
dependencies:
  angular:
    git:  '[email protected]:angular/angular.dart'
  third_party_angular_plugin: any

the problem is third_party_angular_plugin is depending on stable version of angular.dart. I tried to specify as follows:

name: angularApp
dependencies:
  angular:
    git:  '[email protected]:angular/angular.dart'
  third_party_angular_plugin: any
dependency_overrides:
  angular:
    version: ">=0.9.10"

But it throws a weird error saying Bad State: No elements dart:core List.single ....

How can I override third_party_angular_plugin's dependency on angular for my app?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The version is not a separate nested key, as per the example on Pub Dependencies page, the right format is this:

name: angularApp
dependencies:
  angular:
    git:  '[email protected]:angular/angular.dart'
  third_party_angular_plugin: any
dependency_overrides:
  angular: ">=0.9.10"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...