To actually use Flutter, we need to save the location of the Flutter executable to your system's environment variables.
Newer Macs use the Z shell (also known as zsh). This is basically an improved version of the older Bash, with several additional features.
When using zsh, you can add a line to your zshrc file, which is a text file that contains the zsh configuration. If the file does not exist yet, you can create a new file, as follows:
- Open the zshrc file with the following command:
nano $HOME/.zshrc
This will open a basic text editor called nano in your terminal window. There are other popular tools, such as vim and emacs, that will also work.
- Type the following command at the bottom of the file:
export PATH="$PATH:$HOME/flutter/bin"
- If you chose to install Flutter at a different location, then replace $HOME with the appropriate directory.
- Exit nano by typing Ctrl + X. Don't forget to save your file when...