目前有了一個flutter庫要釋出,摸索了一下發布流程貼在這裡供大家參考。
建立flutter庫
先建立一個Flutter庫工程,再在此庫工程中建立Flutter專案。
flutter庫的目錄結構如下,目錄名不要變:

註冊賬號
pub.dev是Dart官方的倉庫地址,首先在此註冊賬號,需要Google賬號和全域性翻/牆。

認證Verified Publisher
首先verified publisher意思是已驗證開發者,與普通開發者的主要區別是可以隱藏自己的email地址,同時加個badge,像這樣:

註冊Verified Publisher需要有一個網站地址。什麼你說沒有域名?為了註冊 .dev 的域名我是去GoDaddy去申請的,還有個好處是不用備/案。 準備好域名後在pub.dev介面上點選使用者頭像,選擇Create Publisher, 出現這個介面:





釋出
釋出非常簡單,首先執行下面命令先提前檢測下要上傳的庫有沒有問題,有問題Flutter會提示warning,按提示解決即可。
pub publish --dry-run
複製程式碼
處理完後執行:
# 國內使用者應該都有使用flutter提供的中國映象,所以上傳時要指明上傳到https://pub.dartlang.org地址。
flutter packages pub publish --server=https://pub.dartlang.org
複製程式碼
會出現類似如下的介面:

已認證verified publisher使用者需要的額外處理
上面上傳上去的庫還是以個人的名義上傳的,要統一到publisher賬戶需要進行一次手動轉移。 在開啟的庫頁面選擇Admin標籤,再點選Transfer to Publisher轉移到相應的publisher賬戶即可,成功顯示如下效果:
