How To Install and Setup Flutter Environment in MacOS

Flutter is Google’s UI toolkit for building applications for mobile, web, and desktop from one single codebase. Flutter relies on the dart programming language and uses a compiler for natively building applications for the various target platforms.



So before directly hopping into making cool applications, there’s a slightly painful process of setting up a flutter environment in your system.

The intention of this article is to make the process easier, faster and to save you from watching hours of tutorials.

The first step is to download the installation bundle and get the latest, stable
release of flutter SDK from the official flutter website.
Then extract the file in the desired location using your convenient way of unzipping. I have saved mine on the desktop (it’s easily accessible), as you’ll see later. All the commands will also pertain to the same.

Next, you have to get the exact path, i.e where the tool is installed in your system.You have to just fire up your terminal or command line prompt, and type in the following. 

cd desktop/flutter
followed by
pwd

This will return the exact path to your flutter file.
It’s preferable to copy-paste the returned path to your notepad, it will prove to be handy later.




Next, we have to add flutter to our PATH. We have to make an entry to the .bash_profile in our system using any editors like vim, nano etc. Here, we are using vim.
The command to be written is:
If you are not in your home directory, type the command:
cd
Then
vim .bash_profile




It will open up the file, and now we have to make an entry to the file. We have to type the following in the .bash_profile. ( anywhere before the ~ symbols start )

(To make an entry, you have to press ‘I’ which will launch the insert mode)

To be typed:( Just paste the path returned earlier, followed by ‘/bin:$PATH’ )
export PATH=/Users/Liza123/desktop/flutter/bin:$PATH

(Then, press  escape followed by )
Type in at the end of all ~ signs
:wq



So,that’s it.It’s almost done!!

You can run the following command to see if the installation was successful.
flutter doctor




It may not look the same, depending upon what else you have installed and what you haven’t , but if the command works then that's a win!



This article is contributed by Elizabeth Mathew. If you would like to contribute to Hackzism you can also write an article and mail to hackzism.hack@gmail.com
Your article will be published on our home page.

Comments

Popular Posts