![91e6fe2a3db5fbe7359f5e223362c525.png](https://img-blog.csdnimg.cn/img_convert/91e6fe2a3db5fbe7359f5e223362c525.png)
前言
工欲善其事,必先利其器
所以第一篇我们来说说 Flutter 环境的搭建。
笔者这边使用的是 MAC 电脑,因此以 MAC 电脑的环境搭建为例。
Windows 或者 Linux 也是类似的操作。
Flutter 有英文版的官网和中文网,大家可以根据自己的喜好和情况进行选择。
点击下面的链接可以到对应的安装页面。
Flutter 官网安装链接:https://flutter.io/docs/get-started/install
Flutter 中文网安装链接:https://flutterchina.club/get-started/install/
我们这边以官网为例进行说明。
目录
![eaf0671b366cf4c1814ce57241d76c1e.png](https://img-blog.csdnimg.cn/img_convert/eaf0671b366cf4c1814ce57241d76c1e.png)
1. 配置镜像
点击进入官网,可以看到下图:
![a980c8e64dc2ecda936976feb65e2a53.png](https://img-blog.csdnimg.cn/img_convert/a980c8e64dc2ecda936976feb65e2a53.png)
我们点击 Using Flutter in China 进入:
![902ff4d8a1f89c44875e33a8fcc64c77.png](https://img-blog.csdnimg.cn/img_convert/902ff4d8a1f89c44875e33a8fcc64c77.png)
可以看到主要是让我们配置镜像站点。
所以我们就将要求的两个环境变量添加到系统就可以了。
打开 terminal,看下当前用户下面是否有 bash_profile 文件,执行命令:
vi ~/.bash_profile
如果底部有
"~/.bash_profile