Flutter dependencies是什么
依赖第三方包 用法:
dependencies:
flutter:
sdk: flutter
google_ml_kit:
path: ../../plugin/Google-Ml-Kit-plugin
image_picker: ^0.7.2
camera: "0.9.4+11"
用法1
依赖本地模块
google_ml_kit:
path: ../../plugin/Google-Ml-Kit-plugin
用法2
依赖git模块
flutter_boost:
git:
url: 'https://github.com/alibaba/flutter_boost.git'
ref: 'v3.0-preview.18'
用法3
依赖pub包
image_picker: ^0.7.2
camera: "0.9.4+11"
注意:
使用^前缀,会当该包有新版本时,运行执行flutter pub get会自动拉取最新版本的库代码;
使用""则显式指定库版本,运行执行flutter pub get会拉取指定版本的代码
示例:
image_picker: ^0.7.2
"camera: "0.9.4+11"