一、下载SDK
1.官网下载 https://docs.flutter.dev/development/tools/sdk/releases?tab=macos 2.git下载 git clone https://github.com/flutter/flutter.git -b stable 3.通过brew命令下载 brew install --cask flutter
二、检查是否安装成功
flutter doctor
三、如果检查失败,检查环境变量并配置【配置完成之后,再执行flutter doctor,进行检查】
export FLUTTER_ROOT=你的flutter安装目录 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=$PATH:/你的flutter安装目录/bin
四、创建项目
flutter create 项目名称
创建完项目就可以,在lib下面编辑代码了