Hi Everyone!
Flutter is a cross-platform software development kit by Google. It is one of the burning topic of the Internet. So to get started with it we need to install the sdk and all other dependencies correctly for it to run on our laptop successfully.
Here is a very short article explaining how to install Flutter on your MacBook with seven easy steps.
Step-1: Install Flutter SDK from its official website.
OR
You can download the zip file from here.
Step-2: Save the zip file to your desired location or preferably to Documents. Mark the path to this location(to be used on later steps).
Step-3: Open Terminal (CMD+Space and search Terminal)
Type ls and check if 'Documents' folder is showing.
If not showing then type cd ~ to go to home directory.
Step-4: Unzip the file using any file archiver utility like WinRAR
OR
Use follow these sub-steps to unzip using terminal
1-->
cd Documents
2-->
unzip ~/Downloads/flutter_macos_2.10.0-stable.zip
Step-5: Adding flutter to path (temporarily).
export PATH="$PATH:`pwd`/flutter/bin"
Run flutter doctor command to ensure flutter is working.
After you close the terminal then you won't be able to use flutter commands through terminal again. So we need to add flutter tools to path permanently.
Step-6: Adding flutter tool to path (permanently). This step is bit complicated, so be careful.
Run pwd on the terminal and copy the path and save it somewhere.
Then run echo $0 to which shell you are using.
If you are getting ~zsh then follow these steps:
vim ~/.zshrcRun this command to open vim editorexport PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
Write this command on vim editor.
Here replace [PATH_OF_FLUTTER_GIT_DIRECTORY] with the path that you got by running thepwdcommand earlierPress ESC
Type
:wqand press Enter
If you are using ~bash then follow these steps:
touch ~/.bash_profile; open ~/.bash_profileThis opens TextEdit File.export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
Type this command on and replace [PATH_OF_FLUTTER_GIT_DIRECTORY] with the path that you got by running thepwdcommand earlierSave the file
Step-7: Run this command to confirm that the path is added successfully.
flutter doctor
You can visit the Official Flutter Installation documentation for MacOS installation guide.
If you have any query then contact me through LinkedIn.
Top comments (0)