Как ссылаться на пакеты из репозитория во Flutter?
Я пытаюсь изменить существующий пакет на 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
в папке пакетов? Их там 2 ... Не знаете, как это сделать?
Пакет - graphql_flutter
1 ответ
Решение
Это потому, что это репо с несколькими пакетами. Вам нужно напрямую ссылаться на путь и ветвь, точно так же, например, для
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