How to configure flutter development environment in your windows machine

Flutter is an amazing cross platform mobile development toolkit which is introduced by Google. It’s easy to adopt to any developer. Dart is the language used behind this toolkit. In short, a single code base and deliver it for all three platforms like Android/iOS/Web.

Below are the prerequisites to install Flutter setup

  • Download and Install Android Studio latest version for Windows 64-bit
  • Download and Install the latest stable version of Visual Studio Code
  • Check your disk space for the availability of 1.32 GB

Download and Install Flutter:

There are two ways to get the Futter SDK. One is downloading and extracting the flutter zip file, the other way is cloning the source code from Flutter repo on GitHub

Approach 1

  • Download the latest stable version of Flutter SDK here or to get the other releases, refer SDK archive page.
  • Extract the zip file in the preferred location (It is not recommended to install in the ‘C:\ProgramFiles\’ directory, since it requires elevated permissions)

Approach 2

Add the path of ‘flutter/bin’ in Environment variable:

  • To update the path of flutter/bin in the environment variables, open the ‘Edit environment variables for your account’ by searching in Start search bar
  • After opening, click the ‘Path’ and select ‘Edit
  • In the ‘Edit environment variable’ window, click ‘New’ and add the path to ‘flutter/bin’ and click ‘OK’ after adding the path
  • Now close and reopen the flutter console

Check and Install dependencies using flutter doctor:

After updating the path in environment variables, open the flutter console to check for the installation status of platform dependencies.

  • Go to flutter path, and run the command ‘flutter doctor
  • After running flutter doctor, it will show the installation status of the dependencies.
  • If you do not have Android Studio, install and configure from here. And if you do not have Visual Studio code, install the stable version here.
    • Run flutter doctor again in the command prompt to validate the setup.
    • To get the Android licenses, run the below command.
  • After running the command, press ‘y’ to accept all the licenses.
    • Now run the flutter doctor command again to verify that all the dependencies have been installed.

Add Flutter and Dart Plugins in Android Studio:

After installing the dependencies, it’s time to add the extensions. Follow the below steps to install the extension in Android Studio.

  • Open Android Studio, click Configure in the bottom right corner and select Plugins
  • In the search bar, type flutter and select the same.
  • On clicking install, a prompt window will open to ask for Dart installation, click install to install both Flutter and Dart packages
  • Click Restart IDE -> Restart after the installation of packages

Add Flutter and Dart Extension in Visual Studio Code:

To install Flutter and Dart packages in the Visual Studio Code, follow the below instructions.

  • Open Visual Studio code and go to Extension which has been marked red in the below image
  • In the search bar, type flutter. Click and install the same

Note: Installing flutter will automatically install Dart extension. We are all set, now you are ready to build your first mobile app using Flutter! Happy coding!

Sharing is Caring!

Leave a Reply

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