1 下载flutter SDK
git clone https://github.com/flutter/flutter.git -b stable
2 设置flutter环境变量
vim ~/.bash_profile
## 添加环境变量如下:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
## flutter SDK的包改成上一步下载下来的路径
export PATH=/Users/xxx/Desktop/flutter/bin:$PATH
## 刷新配置生效
source ~/.bash_profile
3 初始化flutter
flutter doctor
7FB91C21-13DE-4719-80CF-662C67544493.png
注意:
flutter的大版本更新,建议把第三方库清空
路径:/Users/xxx/.pub-cache
4 开发软件建议使用
- Android studio
- idea
- vscode
网友评论