我們知道下載flutter sdk 可以用過官網和GitHub,但是都非常慢,而且容易失敗,即使配置了鏡像也慢,這裏我推薦一個鏈接
flutter_macos_v1.5.4-hotfix.2-stable.zip下載
這個版本可能比較老了,我們可以通過flutter upgrade
命令進行升級。如果執行該命令報以下錯誤,可以切換到flutter根目錄下,先執行git stash
,再接着執行flutter upgrade
即可,耐心等待執行完
Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these
changes, it is recommended that you stash them via "git stash" or else commit the changes to a local
branch. If it is okay to remove local changes, then re-run this command with --force.