1.下载flutter,解压,放到自己想要的文件下,我是放在/Users/imac/Library/Developer下面的
2.找到flutter在本地的地址:我的地址是/Users/imac/Library/Developer/flutter
3.配置镜像,在终端中输入:
sudo vi ~/.bash_profile
按 i 进行编辑,内容如下:
export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=flutter在本地的地址/bin:$PATH
4.编写完成,按esc,在按 :wq
4.执行下面命令强制使镜像文件生效
source ~/.bash_profile
5.执行下面命令校验是否安装成功
flutter doctor