Flutter Installation


In this tutorial, we will see flutter installation on windows which is basic setup to configure flutter local environment.

Here is the link to setup flutter in windows:

https://flutter.dev/docs/get-started/install/windows

Step1: From the above link, Download latest stable release bundle of the Flutter SDK. The other way to download flutter SDK is using GIT Hub with below command:

git clone https://github.com/flutter/flutter.git -b stable

Step2: Extract the ZIP and copy to your local folder

Step3: Navigate to bin folder or extracted flutter SDK

Step4: Update the path of bin folder to windows path by editing environmental variables

Run Flutter Doctor

After setting path of flutter, now run the flutter doctor command. Before this step, you must download Android studio so that flutter doctor command will configure path of Android.

C:\softwares>flutter doctor
Running "flutter pub get" in flutter_tools...                      13.4s
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.1237], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Community Edition (version 2021.1)
[√] VS Code (version 1.60.2)
[√] Connected device (3 available)

• No issues found!

C:\softwares>

If you don’t install the Android Studio then you will get the error as shown in below:

C:\softwares>flutter doctor
Downloading Material fonts...                                      894ms
Downloading Gradle Wrapper...                                       34ms
Downloading package sky_engine...                                  206ms
Downloading flutter_patched_sdk tools...                           533ms
Downloading flutter_patched_sdk_product tools...                   527ms
Downloading windows-x64 tools...                                    6.0s
Downloading windows-x64/font-subset tools...                     1,053ms
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1110], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[!] Android Studio (not installed)
[√] IntelliJ IDEA Community Edition (version 2021.1)
[√] VS Code (version 1.57.1)
[√] Connected device (2 available)

! Doctor found issues in 2 categories.

Update Android Path to Flutter and accept license

To fix above issues, Execute below commands in order to update the path of Android Studio and License as well. You need to run flutter doctor command also after accepting license.

flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"
flutter doctor --android-licenses
flutter doctor

you might get some errors while running “flutter doctor –android-licenses” command and check below post for solution:

Development Tools

Visual Studio Code: Most of the developers first choice is Visual Studio Code which is light weight development IDE and install flutter, dart extensions

Android Studio: Some native android uses Android Studio for app development using flutter

XCode: XCode is required to build IOS applications and which is mandatory. IOS applications can be developed using windows, still they need to use Xcode to generate IPA file

How to test apps when we use Flutter?

  1. For Windows users, use Android emulator which can downloaded and started using AVD manager from Android Studio. We can setup target emulator from Visual Studio code as well
  2. For Mac users, they can use IOS emulator to test IOS applications
  3. We can still use our android devices to test the applications

As shown in below, Click on AVD Manager to run Android emulator

For the time, you might need to create Virtual Device and download Android OS as shown in below:

If there is no Virtual device is configured then click on “Create Virtual Device” to download the Android OS as shown in below:

How to start Android Emulator from Visual Studio Code:

Make sure the you enable Flutter Device at status bar of Visual Studio Code. If enabled then click on Flutter Device as shown in below

Run the flutter devices

Run the flutter devices command to check the list of platforms available to run the flutter applications

C:\softwares>flutter devices
3 connected devices:

sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
Chrome (web)                • chrome        • web-javascript • Google Chrome 94.0.4606.61
Edge (web)                  • edge          • web-javascript • Microsoft Edge 94.0.992.38

Check for flutter firebase configuration setup in flutter app in this tutorial

Leave a Reply

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