Ads

Monday, 23 August 2021

Flutter Setup In Mac

 Hi Guys, 

I have mac machine, so I am going to tell you how to install flutter in MAC machine.

  • Download Flutter Stable SDK version and save in you machine which is required while setting the IDE. I prefer it to be saved in 'Documents' folder.
    1. In my case I have saved it in 'Documents/SDKs'
    2. Unzip the Flutter Stable SDK zip file
    3. Open terminal and type the following commands
      1. $ cd ~/Documents/SDKs/flutter
      2. $ export PATH="$PATH:`pwd`/flutter/bin"
    4. The Step 3 is for the particular terminal window only, to make it permanent follow the below process in the terminal
      1. $ echo $SHELL 
      2. The above command will tell you what kind of shell is your macbook is. In my case it is Z shell
      3. $ export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
      4. To verify use command $ echo $PATH
      5. To verify the flutter is working use the command $which flutter
    5. The above command should provide with the path.
  • Once the SDK setup is completed, we have to setup the IDE. Below is the process to setup.
    1. Download the xcode and command line tools to run on iOS device/ Simulator.
    2. To run on Android device, follow the below process.
      1. Download and install Android studio.
      2. Once Android studio installed, go to the Android studio setup wizard and install 
        1. Latest Android SDK
        2. Latest Android SDK command line tools
        3. Latest Android SDK build tools
      3. Open Preference from the Android studio, go to Plugins and search for "Flutter". If it is not installed, install it. 
      4. Similarly, install Dart and Kotlin.
  • Once the IDE and SDK setup is completed, check what is the version of JAVA that is active. For flutter to work JAVA 8 should be active. If Java 8 is not installed, install Java 8 and do the following
    1. Open terminal and follow the commands
      1. $ nano ~/.zhenv
      2. Z Shell file will opened and enter the below text
      3. export JAVA_HOME=$(/usr/libexec/java_home -v1.8)
  • Finally, run the command in the terminal $ flutter doctor
    • If you get any error related to "Android license status unknown", Do the following
    • In terminal, type the command $ flutter doctor --android-licenses
    • Then it ask to accept the licenses, please accept and continue.

No comments:

Post a Comment

SOLID Principles

SOLID principles are the basic essential thing to know for every developer before he/she starts coding in any IDE. Here is the full form S ...