1.创建FlutterSDK文件夹,通过终端cd进该文件夹路径;
2.下载sdk:git clone -b master https://github.com/flutter/flutter.git
3.运行:./flutter/bin/flutter --version
4.在当前路径下配置:
exportPUB_HOSTED_URL=https://pub.flutter-io.cn//(国内用户需设置)
exportFLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn//(国内用户需设置)
export PATH=${PATH}:“FlutterSDK文件夹的路径”/flutter/bin:PATH
5.执行flutter doctor (如果执行无效果,先执行source ~/.bashrc)
6.在vs code商店搜索flutter安装插件
7.重新启动vs code
8.通过vs code命令面板搜索Flutter-> NewProject 创建工程