You can install Flutter on Windows with some minimum system requirements first, such as:
- Operating System: Minimum Windows 10 (64bit), X86-64.
- Disk space: Minimum 1.64GB of free disk space (not including for IDE/tools).
- Tools: Flutter requires the following tools to be available in the Windows environment
- Windows PowerShell 5.0 or later (This is usually installed with Windows 10)
- Git for Windows 2.x. Download and install Git (Link: https://git-scm.com/download/win). If Git has been installed, make sure that git can be run at the command prompt or in PowerShell.
Get the Flutter SDK
- Download flutter SDK (link: https://docs.flutter.dev/development/tools/sdk/releases). Choose flutter version 3.3.10 to match the flutter version used in this tutorial.
- Extract the flutter zip file to the desired location, for example C:\src\flutter. However, what should be noted is:
- Don’t install flutter with a folder that uses special characters or spaces.
- Don’t install flutter in a directory that requires access privilege like C:\Program Files.
in order to run flutter command in windows console, add flutter path in environment variable. follow these steps:
- In the windows search bar, type ‘env’. And select Edit the system environment variables.
- Click the Environment Variables button.
- Select the path and click the edit button.
- Click New and add C:\src\flutter\bin. Then click OK
To check if it’s running, please open a command prompt and type ‘where flutter dart’. Then it will appear like the image below:
Check Other Flutter Tools
To check whether flutter can be run, or if there are still things that need to be completed, please open a command prompt and type ‘Flutter doctor‘. Then a description will appear as shown below:
From the image above, it can be seen that flutter requires Android studio and visual studio to be installed.
Install Android Studio
- Download and install Android Studio (link: https://developer.android.com/studio).
- Run Android studio, and enter the ‘Android Studio Setup Wizard’. This will install Android SDK, Android SDK Command-line tools and Android SDK Build-Tools. And everything flutter needs. There are 2 licenses that must be accepted, namely: android-sdk-licence and intel-android-extra-licence. Click license and Accept everything. Finally Click Finish.
After finishing installing Android studio, run Flutter doctor again to make sure that Android studio is installed. But if it’s not visible, it’s probably because the Android studio directory hasn’t been set correctly. please run flutter config –android-studio-dir . Enter the Android studio directory that was installed earlier. For example like this:
flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"
Install Android SDK Command-line Tools (latest)
1.Enter Android studio, click More Action > click SDK Manager
2.Click the Android SDK menu > SDK Tools, then check the Android SDK Command-line Tools (latest) box. Click OK
Install Visual Studio
- Download and install android studio (link: https://visualstudio.microsoft.com/downloads/). Here we will use Visual studio 2022 edition Community.
- Install visual studio Desktop development with C++ with all default components. Make sure that Windows 10 has a minimum version of 1909 before.
Android Device Settings (Mobile)
In order for an android device (phone) to be able to run flutter applications directly, we need an android device that uses Android version 4.1 (API level 16) or a newer version.
Here are the steps to activate it:
- Activate Developer options (developer options) and USB debugging on the android device (phone). The method may differ depending on the cellphone used. Here we try to give an example of a common way:
- Go to settings > About phone > Software information > Click repeatedly on Version Number until a notification or request for a pin appears > enter the pin when prompted. Then a notification will appear that developer mode has been activated.
- Go to settings > developer options > enable USB debugging
- Only for Windows: Install the Google USB driver by: Entering Android studio > More Action > SDK Manager > Select the SDK Tools menu > tick Google USB Driver, then click OK.
Use a USB cable and connect the phone to the computer. A notification will appear on the cellphone to allow the computer to access the cellphone. It will also appear to allow phone debugging. then Click Allow.
To check whether the cellphone is connected, please open a command prompt and run the command ‘flutter devices’ then it will appear as shown below. It can be seen that the SM J15f mobile device (mobile) is already connected.
Setup Android Emulator
1.Run Android studio, Select Virtual Device Manager > Create Device
2.Select a category phone > Select a cellphone, for example, select Pixel 5
3.Select a system image. Because earlier we used a cellphone with Android version 9.0, here we try to use the same version for use on the Android emulator.
4.Click the download icon as circled in the image below, then accept the license. Wait for the download process to finish.
5.Run the emulator: Click the play icon as shown below
6.If successful, an emulator will appear as shown below
Agree to the Android License
In order to use flutter, you must agree to the license of the Android SDK platform first.
Open command prompt then run the following command:
flutter doctor --android-licenses
And agree to all licenses by typing Y and enter.
have been completed