1. vim ~/.bash_profile
打开后粘贴:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/crash/flutter/bin:$PAT
其中:/Users/crash 为flutter sdk 路径,可以任意替换为您的flutter 路径
2.source ~/.zshrc
3. 执行flutter doctor 即可
4.注意点:只能用vim ~/.bash_profile,使用open ~/.bash_profile 后刷新当前窗口,只能单次使用
关闭终端,找不到flutter