Flutter随笔

Flutter插件开发

2019-11-09  本文已影响0人  嘛尼嘛哄

基本介绍:

Flutter包的官方地址: https://pub.dartlang.org/
Flutter包的国内镜像地址: https://pub.flutter-io.cn
Flutter创建基本步骤,官方教程传送门: https://flutterchina.club/developing-packages/

发布插件关键步骤

  1. check plugin contents
    flutter packages pub publish --dry-run --server={your pub server}
  2. 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
  3. connected VPN
    lantern/ShadowsocksX ....
  4. set terminal proxy
    export http_proxy & https_proxy
  5. check domains:
    curl www.google.com
  6. publish packages
    flutter packages pub publish --dry-run --server={your pub server}

注意事项

  1. 中国地区的朋友发布时需要将PUB_HOSTED_URLFLUTTER_STORAGE_BASE_URL注释掉
  2. 需提前设置好终端的代理,确保ping www.google.com或者curl www.google.com成功
  3. 发布终端代理时指定发布的服务器为官方服务器[https://pub.dartlang.org], 这一步很关键,如果不指定默认就是https://pub.flutter-io.cn,肯定是推不上去的。
上一篇下一篇

猜你喜欢

热点阅读