1 Windows

(1) 下载 Flutter SDK

image.png

  • 将安装包zip解压到你想安装Flutter SDK的路径(如:E:)
  • 在Flutter安装目录的flutter文件下找到flutter_console.bat,双击运行并启动flutter命令行,接下来,你就可以在Flutter命令行运行flutter命令了。

image.png

(2) 更改环境变量

由于在国内访问Flutter有时可能会受到限制,Flutter官方为中国开发者搭建了临时镜像,大家可以将如下环境变量加入到用户环境变量中:
image.png
image.png
然后重启windows文件资源管理器, 重新加载环境变量

2 Mac

(1) 下载Flutter SDK

image.png
解压到/usr/local/bin下

unzip ~/Downloads/flutter_macos_2.8.1-stable.zip -d /usr/local/bin

(2) 更改环境变量

vi ~/.bash_profile

  1. export PUB_HOSTED_URL=https://pub.flutter-io.cn
  2. export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
  3. export PATH=$PATH:/usr/local/bin/flutter/bin
  4. export DART_HOME=~/usr/local/bin/flutter/bin/cache/dart-sdk/bin

source ~/.bash_profile

3 Linux

  1. sudo snap install flutter --classic
  2. flutter --version
  3. flutter sdk-path