You need to correctly set up your Flutter path.
From macOS install – Update your path:
- Determine the directory where you placed the Flutter SDK. You will need this in Step 3.
- Open (or create)
$HOME/.bash_profile. You can do that by using terminal text editor by going in terminal and typing
nano ~/.bash_profilemacOS v10.15 (Catalina) uses the Z shell by default, so edit $file HOME/.zshrc.If you are using a different shell, the file path and filename will be different on your machine.
- Add the following line and change
[PATH_TO_FLUTTER_GIT_DIRECTORY]to be the path where you cloned Flutter’s Git repository is:
export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATHFor example:
- Press Ctrl + X and when it asks you to save the file, choose Yes
source $HOME/.bash_profileto refresh the current window or restart the terminal
- Verify that the
flutter/bindirectory is now in your PATH by running:
echo $PATHNotice that
[PATH_TO_FLUTTER_GIT_DIRECTORY]is where you installed Flutter SDK, not the location of your app
Instead of nano, you can use any text editor to edit file
- Open Terminal
- restart terminal
flutter doctor -v
For example : if flutter in your machine has been installed under [your_username]/Developer/flutter