post image

Once you have install flutter in your development environment you will need to handle a couple of things link adding the sdk to the path permanently. Adding the flutter SDK to Linux path permanently permit you to run flutter commands in any terminal. Now let get started on how you can add the flutter SDK Linux path permanently

1) First of all 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

kevine@kevine-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

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

Where[PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you placed the downloaded flutter sdk for example

export PATH="$PATH:/home/kevine/flutter/bin"

3) Refresh your current window or open another tab to verify that the flutter/bin directory is now in your PATH by running:

kevine@kevine-Latitude-E6430:~$ echo $PATH

The results will look like something like this below. Make sure you verify that the flutter path appears.

/home/kevine/.nvm/versions/node/v12.20.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/dart/bin:/home/kevine/Android/Sdk/emulator:/home/kevine/Android/Sdk/tools:/home/kevine/Android/Sdk/tools/bin:/home/kevine/Android/Sdk/platform-tools:/home/kevine/flutter/bin

If all goes well then you can start your flutter development and also start using flutter commands in any terminal. If you don’t have Android Studio setup already no problem, in the next article, I will help you with some steps in order for you to setup android studio and run your first flutter application.

Some flutter commands

flutter doctor

You can use the above command to see if there are any dependencies you need to install.

which flutter

This command verifies that the flutter command is available.

For any additional information on how to setup path with bash you can write directly here or visit any forum like Stack-overflow.

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: