如何在 Flutter 中引用存储库中的包?

flu*_*ter 10 git package flutter pubspec

我正在尝试修改 pub.dev 上的现有包。我需要更新包中的依赖项之一。我已经从这里看到了如何做到这一点

dependencies:
  flutter:
    sdk: flutter
  graphql_flutter:
    git:
      url: https://github.com/username/graphql-flutter.git
Run Code Online (Sandbox Code Playgroud)

当我跑步时flutter pub get
我得到pub get failed (1; Could not find a file named "pubspec.yaml"

查看存储库

pubspec.yaml根里没有

我想我需要引用pubspec.yaml包文件夹中的?那里有 2 个...不知道该怎么做?

该包是graphql_flutter

Mig*_*ivo 14

那是因为这是一个包含多个包的存储库。您需要直接引用路径和分支,就像这样,例如分支master

graphql_flutter:
    git:
      url: https://github.com/zino-app/graphql-flutter.git
      ref: master
      path: packages/graphql_flutter
Run Code Online (Sandbox Code Playgroud)

如果您想要两个包:

graphql_flutter:
    git:
      url: https://github.com/zino-app/graphql-flutter.git
      ref: master
      path: packages/graphql_flutter

graphql:
    git:
      url: https://github.com/zino-app/graphql-flutter.git
      ref: master
      path: packages/graphql
Run Code Online (Sandbox Code Playgroud)