How to reference packages from repository in Flutter?
2,241
That's because that's a repo with multiple packages. You need to reference the path and branch directly, just like so, for example for the master
branch:
graphql_flutter:
git:
url: https://github.com/zino-app/graphql-flutter.git
ref: master
path: packages/graphql_flutter
If you want both packages:
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
Author by
flutter
Updated on December 28, 2022Comments
-
flutter over 1 year
I'm trying to modify an existing package on pub.dev. I need to update one of the dependencies in the package. I've seen how to do this from here
dependencies: flutter: sdk: flutter graphql_flutter: git: url: https://github.com/username/graphql-flutter.git
When I run
flutter pub get
I getpub get failed (1; Could not find a file named "pubspec.yaml"
Looking at the repository
There is no
pubspec.yaml
in the rootI presume I need to reference the
pubspec.yaml
in the packages folder? There is 2 of them there... Not sure how to do this?The package is graphql_flutter
-
flutter about 3 yearscheers, how would add the 2 paths for the 2 packages?