我在使用带有pubspec.yaml文件中存储库包的flutter pub get
时遇到问题。
dependencies:
flutter:
sdk: flutter
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview
遵循提供的步骤https://dart.dev/tools/pub/dependencies#git-包裹。
然而,我得到错误
Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.
pub get failed (1; Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.)
我不知道我应该为存储库中不存在的pubspec.yaml放什么。如果您使用flutter pub add flutter_stripe
按原样调用程序包,它也可以正常工作。
我被要求使用非官方分支的原因是包提供的一个字段工作不正常,建议的解决方案是使用此分支。
对不起,我不知道Hosted包的根不是最终路径。我被要求添加一个包的路径,然后可以在中找到/包装/条纹。
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview
path: ./packages/stripe
对于任何和我有同样问题的人……或者也许我只是个无名小卒
如果你查看git项目的包,你可以看到不止一个包:https://github.com/flutter-stripe/flutter_stripe/tree/main/packages你必须选择你需要的包裹。