Flutter插件开发
2019-11-09 本文已影响0人
嘛尼嘛哄
基本介绍:
Flutter包的官方地址: https://pub.dartlang.org/
Flutter包的国内镜像地址: https://pub.flutter-io.cn
Flutter创建基本步骤,官方教程传送门: https://flutterchina.club/developing-packages/
发布插件关键步骤
- check plugin contents
flutter packages pub publish --dry-run --server={your pub server} - remove local flutter proxy in
/.bash_profile
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn - connected VPN
lantern/ShadowsocksX .... - set terminal proxy
export http_proxy & https_proxy - check domains:
curl www.google.com - publish packages
flutter packages pub publish --dry-run --server={your pub server}
注意事项
- 中国地区的朋友发布时需要将
PUB_HOSTED_URL
和FLUTTER_STORAGE_BASE_URL
注释掉 - 需提前设置好终端的代理,确保ping www.google.com或者curl www.google.com成功
- 发布终端代理时指定发布的服务器为官方服务器
[https://pub.dartlang.org]
, 这一步很关键,如果不指定默认就是https://pub.flutter-io.cn
,肯定是推不上去的。