在flutter的yaml文件中添加模块依赖,使用git依赖如下:
dependencies:
test:
git: ssh://********test.git
运行pub get,报错:
网上搜索“Mapping values are not allowed heae.Did you miss a colon earlier?”相关错误,这个错误基本都是由于yaml文件的格式有问题导致,我仔细检查yaml文件后,并未发现格式上的不妥,在没办法后,尝试使用本地依赖,把代码模块下载到本地,然后依赖改成:
dependencies:
test:
path: ../test
运行pub get,编译依赖成功。
这里我不能理解,最开始的依赖写法其实是没问题的,同事的Mac电脑是可以依赖成功,但是在我的windows上就依赖失败报错,只能改本地模块依赖。猜测是windows不支持git依赖方式?但是在依赖flutter_boost时候是可以的:
dependencies:
flutter_boost:
git:
url: 'https://github.com/alibaba/flutter_boost.git'
ref: 'v3.0-null-safety-preview.9'
不知道有没有大神可以指导下?