Categories
Flutter

Flutter Setup

HelloWorld! In this article, you will learn about how to setup Flutter in Windows, Linux, and Mac OS through step by step simple procedure. Let’s get started,

Prerequisites

  • Android Studio
  • X Code and CocoaPods only for Mac OS
  • VS Code editor or any other editor. VS code editor is recommended because it has the Flutter plugin which helps in fast debugging
  • Git version control
  • Install Flutter and Dart plugin in Android studio.

Setup for Windows

Minimum requirements

  • Require at least Windows 7 SP1 or later
  • Disk space around 1.3 GB required only for flutter setup
  • Flutter depends on Windows PowerShell 5.0 or newer (this is pre-installed with windows 10), if your using windows 10 don’t worry about it and if you want to clone the GitHub repository have to install Git

To download Git for Windows x86 and Windows x64.

Download and setup Flutter

  • Download the Flutter SDK from this link or clone the Flutter’s repository by executing the following command in your terminal,
git clone https://github.com/flutter/flutter.git -b stable
  • After completion of the download, extract the file in your desired location for example (C:\flutter),
  • Don’t place the Flutter SDK inside the program files it may require some elevated privileges.

Next step is to add the Flutter path in your system environment variable, by the following steps. This enables us to execute all Flutter commands from the command prompt:

  1. From the Windows search look for ‘env’, then select edit environment variables for your account
  2. In under the user variables check there is any variable named Path if exists paste the Flutter SDK full path, example (C:\Flutter\bin) in values if any values exist separate between the two values using ‘;’, if not exists create a new variable name it as path and paste the Flutter SDK location in the value.

Last step in Flutter setup

Open the command prompt, run flutter doctor a command will let you know there are any dependencies to complete the Flutter setup.

If it shows an error like Android license status unknown, you can resolve this by executing the following command line in your terminal.

flutter doctor --android-licenses

If you get logs like the following screenshot you have done.

Setup for Linux

Minimum requirements

  • Minimum disk space around 600MB
  • Operating system Linux 64Bit

Download and setup Flutter

  • Download the Flutter SDK from this link or clone the Flutter’s repository by executing the following command in your terminal,
git clone https://github.com/flutter/flutter.git -b stable --depth 1
  • After completion of the download, extract the file in your desired location for example (/home/`userName`/flutter)
  • Add Flutter tool to your path, open the .bashrc file from your home folder then paste the following line
  • By default the file was been hidden, so check the show hidden files from menu, then open and the add this line
export PATH="$PATH:`pwd`/flutter/bin"

Last step in Flutter setup

Open the terminal, run flutter doctor a command will let you know there are any dependencies to complete the Flutter setup.

If it shows an error like Android license status unknown, you can resolve this by executing the following command line in your terminal

flutter doctor --android-licenses

If you get logs like the following screenshot you have done.

Setup for Mac OS

Minimum requirements

  • Minimum disk space around 2.8Gb and
  • Operating system Linux 64Bit

Download and setup Flutter

  • Download the Flutter SDK from this link or clone the Flutter’s repository from this link,
git clone https://github.com/flutter/flutter.git -b stable --depth 1
  • After completion of the download, unzip the file in the desired location for example (/home/`userName`/flutter)
  • To add the Flutter tool to your path, before that by typing echo $SHELL it will show what shell you are using
  • If you are using the Z shell (ZSH) edit ./zshrc file which is located in your home folder. command + shift + h a shortcut to navigate Home folder in Finder
  • If you’re using Bash shell, edit $HOME/.bashrc or $HOME/.bash_profile. Next is add the following line in the corresponding file by using editor

Last step in Flutter setup

Open the terminal, run flutter doctor a command will let you know there are any dependencies to complete the Flutter setup.

If it shows an error like Android license status unknown, you can resolve this by executing the following command line in your terminal

flutter doctor --android-licenses

If you get logs like the following screenshot you have done.

One reply on “Flutter Setup”

Leave a Reply

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