Mac vscode配置flutter&创建项目

1、将项目clone到/Users/xx/

git clone -b dev https://github.com/flutter/flutter.git

或者直接下载Flutter SDK

https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos

2、配置flutter路径

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/xx/flutter/bin:$PATH

设置配置文件立即生效

source ~/.bash_profile

3、下载flutter工具

cd ./flutter
flutter doctor

4、创建项目

vscode -> 查看 -> 命令面板 -> Flutter: new project -> 输入项目名称

Mac vscode配置flutter&创建项目_第1张图片

5、运行项目

右下角选中设置,vscode -> 启动调试

Mac vscode配置flutter&创建项目_第2张图片

你可能感兴趣的:(Flutter,Flutter学习)