- 配置永久环境变量:
1、执行命令:
open ~/.bash_profile
2、打开文件,在里面添加上:
# flutter
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=${PATH}:/Users/yuanzhiying/Library/flutter/bin
3、执行
source ~/.bash_profile
4、验证
echo $PATH
5、重新尝试flutter packages get
,会发现,很快就ok啦
网友评论