創(chuàng)建項(xiàng)目
$ flutter create --template=package hb_password_input_textfield
image.png
創(chuàng)建完項(xiàng)目打開
image.png
放上自己的代碼
image.png
檢查
$ flutter packages pub publish --dry-run
提示報(bào)錯
Your pubspec.yaml includes an "author" section which is no longer used and may be removed.
image.png
去掉author這一項(xiàng)
image.png
再重新檢查,0錯誤蝗蛙,表示可以提交捡硅。
image.png
發(fā)布
首先需要一個全局的神奇上網(wǎng)工具(大家都懂的)
測試一下能不能用
$ curl www.google.com
下圖表示行得通的
image.png
輸入以下命令行 開始提交
$ flutter packages pub publish --server=https://pub.dartlang.org
輸入y
image.png
上傳成功
image.png
其他問題
在嘗試發(fā)布包的時候壮韭,提示我Package name "HBSegmentedControl" should be lower-case. Maybe use "hbsegmented_control"?
image.png
首次提交
如果是首次提交喷屋,會有以下提示,根據(jù)圖中操作就可以了屯曹。
(還是要有神奇工具)
image.png