1

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

dependencies:
  flutter:
    sdk: flutter
  graphql_flutter:
    git:
      url: https://github.com/username/graphql-flutter.git

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

查看存储库

pubspec.yaml根中没有

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

包是graphql_flutter

4

1 回答 1

2

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

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

如果你想要两个包:

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
于 2021-03-16T22:03:16.083 回答