Getting Started with Flutter in Windows

Getting started with flutter can be a little daunting in the start, but with the first setup in place, things get easy afterwards. To install and setup flutter for the first time in windows, follow along.

Download/Install Flutter

There are 2 ways to get the flutter development package

  1. Download the latest from https://docs.flutter.dev/get-started/install/windows and extract in the user’s directory, or anywhere else that doesn’t require privileges.
  2. Or clone the stable branch from the official GitHub repo.
git clone https://github.com/flutter/flutter.git -b stable

When updating the next time, it’s showing merge conflicts with diverged branches, even if there are no local changes.

git reset --hard origin/stable
git pull

I went via the 2nd approach of cloning from GitHub, as for new releases I can just do git pull, in place of downloading the whole thing again.

Updating Environment Variables

Environment Variables > User Variables > Path > Edit > New
Add “<path-to-flutter>/bin”

Check for Proper Installation

Running any of the flutter command initiates the “Downloading Dart SDK from Flutter Engine”.
Then execute

path/to/sdkmanager --install "cmdline-tools;latest"

Open Android Studio > Tools > SDK Manager > SDK Tools
Make sure to enable the checkboxes for Android SDK Build-Tools, Android SDK Command-line Tools and Android SDK Platform-Tools

android studio sdk tools

Now it should download and install the required tools

Run “flutter doctor” to see if any more tools are missing

Install Android Studio and VS Code
Then install Flutter and Dart plugins by going to VS Code > Extensions > Search Flutter and install

Open the VS Code command palette from View > Command Palette or by pressing Ctrl + Shift + P keys together

Search flutter, and select “Flutter: Run flutter Doctor”
It should execute the same command we ran earlier in the command line, and should also give similar results

Create First Application with Flutter

Open the command palette again and search for “flutter” and select “Flutter: New Project”, then “Application”

flutter options
flutter new application options

Select the location to create the project in, and give a name to the project

new flutter application

This will create a default project in the specified location, and the structure would look something like the following

default application structure

Running the Flutter Application

In the bottom bar, the target can be changed from Windows (desktop//browsers) to any emulator or any actual phone.

To start the application, open the command line and execute “flutter run”. One can also hit F5

If it’s the first time, it should download required packages

// Attach the application snapshot here

Read more on flutter.

Leave a Reply