去flutter官网下载其最新可用的安装包,或者去Flutter github项目下去下载安装包
或者:
git clone -b stable https://github.com/flutter/flutter.git
- 在命令行输入 sudo vi ~/.bash_profile,然后在里面按I添加:
export PATH=/Users/用户名/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
添加完成后执行:
source ~/.bash_profile
最后运行 flutter doctor查看是否需要安装其它依赖项来完成安装
flutter doctor
网友评论