设置系统环境变量
bash
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
使用以下命令下载flutter镜像
bash
git clone -b stable https://mirror.ghproxy.com/https://github.com/<github仓库地址>
#例如flutter仓库
git clone -b stable https://mirror.ghproxy.com/https://github.com/flutter/flutter.git
添加PATH到环境
其中/path/to/your为你的flutter安装根目录
bash
export PATH="$PATH:/path/to/your/flutter/bin"
运行flutter doctor检测是否安装完成
bash
flutter doctor