Once you have installed Flutter in your development environment you will need to handle a couple of things like adding the SDK to the path permanently. Adding the Flutter SDK to the Linux path permanently permits you to run Flutter commands in any terminal. Now let’s get started on how you can add the Flutter SDK Linux path permanently
1) First step, determine the directory where you placed the downloaded or cloned flutter SDK. You can download it here if you don’t have it(choose a stable release).
Then move to your home folder and hit Ctrl+H to show all hidden files. Look for and open the file .bashrc.
Alternatively, you open a terminal and can run
gun@gun-Latitude-E6430:~$ sudo gedit ~/.bashrc
Note that If you are using a different shell, the file path and filename will be different on your machine.
2) Add the following line at the end of the ./bashrc file and save
[PATH_TO_FLUTTER_GIT_DIRECTORY] is the path where you placed the downloaded Flutter SDK for example
3) Refresh your current window or open another tab to verify that the
flutter/bin directory is now in your PATH by running the command below:
gun@gun-Latitude-E6430:~$ echo $PATH
The results will look something like this below. Make sure you verify that the flutter path appears.
If all goes well then you can start your flutter development and also start using flutter commands in any terminal.
Some flutter commands
You can use the command above to see if there are any dependencies you need to install.
This command verifies that the
flutter command is available.