Is there any way to depend on any ref of git in pubspec of flutter?

1k Views Asked by At

I write two flutter packages A and B. A depends on B using git,

# A pubspec.yaml
dependencies:
  B:
    git: xxxxx

If I depend on both A and B in a project using git url and ref,

# App pubspec.yaml
dependencies:
  A:
    git:
      url: xxxx
      ref: 0.0.1
  B:
    git:
      url: xxxx
      ref: 0.1.0

I get an error w pub get

Because demo_app depends on A from git which depends on B from git, B from git {url: xxxx, ref: HEAD, path: .} is required. So, because demo_app depends on B from git {url: xxxx, ref: 0.1.0, path: .}, version solving failed.

I can use dependency_overrides to resolve this conflict. But is there a more elegant way, such as using agnostic ref, like ref: any for package A?

0

There are 0 best solutions below