0

The steps for modifying this variable permanently for all terminal sessions are machine-specific. Typically you add a line to a file that is executed whenever you open a new window. For example:

  1. Determine the directory where you placed the Flutter SDK. You will need this in Step 3.
  2. Open (or create) $HOME/.bash_profile. The file path and filename might be different on your machine.
  3. Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo:

$ export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"

  1. Run source $HOME/.bash_profile to refresh the current window.

  2. Verify that the flutter/bin directory is now in your PATH by running:

echo $PATH

2 Answers2

0

In mac, you should add it as follows in ".zshrc":

export PATH="$PATH:/Users/matteo/Documents/flutter/bin"

After you have updated the ".zshrc" file, run this command to ensure changes have been notified to OS

source ~/.zshrc

Reference: https://flutter.dev/docs/get-started/install/macos

A similar concept is for Linux system using bash files

-1

I tried a lot of methods but this one permanent solution worked for me like a charm:

  1. open Terminal in your Mac: type: sudo nano /echo/paths

  2. Add the code to the file: /users/yourUserName/flutter/bin

  3. Save the file using Control+X and Press Y and Enter

Hope this helps! :)