目录
1.Flutter官网地址、SDK下载地址?
1.1 选择你电脑的系统
2.配置环境
3.解决环境报错 zsh:command not found:flutter
1.Flutter官网地址、SDK下载地址?
flutter官网地址: URL
1.1 选择你电脑的系统

下载解压动目录就OK了
2.配置环境
1、打开命令行,执行【open ~/.bash_profile 】
2、将下面内容粘贴到.bash_profile文件
export PATH="$PATH:/home/yourusername/flutter/bin"
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
3、执行【source ~/.bash_profile 】,将.bash_profile文件生效
4、执行【flutter doctor】测试效果。
注意哈:
这样配置,如果你只有(bash_profile,没有zshrc文件)。
需要每次打开终端输入一下 source ~/.bash_profile 命令,再使用flutter命令。不然会报错。
zsh:command not found:flutter。
像下面图片效果:
3.解决环境报错 zsh:command not found:flutter
1、执行:【open ~/.zshrc 】
2、如果 提示文件不存在,则执行:【vim ~/.zshrc 】新建一个新文件。
vim ~/.zshrc
3、再执行【open ~/.bash_profile 】
open ~/.bash_profile
4、把 bash_profile 中的内容copy到 zshrc 文件中,保存:【:wq回车】。
5 、再使用source命令重新加载一下:【source ~/.zshrc】,下次再编辑这个文件就可以直接执行:【open ~/.zshrc】
source ~/.zshrc
6、执行【flutter doctor】测试效果
这个时候试试关闭终端再输入flutter doctor,此时问题解决。