Flutter Sdk国内镜像如何配置?
Flutter+Getx仿小米实战视频教程:https://www.itying.com/goods-1176.html
搭建环境过程中要下载很多资源文件,当一些资源下载不了的时候,可能会报各种错误。在国内访问Flutter的时候有可能会受到限制。Flutter官方为我们提供了国内的镜像
https://flutter.dev/community/china
拉到Flutter中文网最下面有配置方式,把下面两句配置到环境变量里面
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn
一、Flutter Windows国内镜像配置
Flutter 社区镜像
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn
清华大学 TUNA 协会镜像
FLUTTER_STORAGE_BASE_URL: https://mirrors.tuna.tsinghua.edu.cn/flutter
PUB_HOSTED_URL: https://mirrors.tuna.tsinghua.edu.cn/dart-pub
二、 Flutter Macos国内镜像配置
vim ~/.bash_profile
vim ~/.zshrc
export PATH=/Users/aishengwanwu/flutter_mac/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
让配置环境变量生效
source ~/.bash_profile
source ~/.zshrc
flutter --version 如果能出来版本说明flutter sdk配置成功。