To work with any technology, you need to set up an environment that supports it. In this blog post, we will discuss how to set up a Flutter development environment on Windows.
Setting up Flutter Development Environment
Getting Started
Setting up a Flutter development environment is as easy as setting up other technologies like .NET, Java, or Python. Before you begin, make sure your system meets the following requirements. Once that's confirmed, you only need to complete the following two tasks.
System Requirements
To install and run Flutter, your development environment must meet these minimum system requirements:- Operating Systems: Windows 10 or later (64-bit), x86-64 based.
- Disk Space: 1.64 GB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these tools being available in your environment.
- Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
- Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.
If Git for Windows is already installed, you can run the Git commands below from the Command Prompt or PowerShell.
Flutter Git Command git --version
If Git is installed, you will see the following result in the Command Prompt. If you not get the result like below then Git is not installed, download it from the link below and install it.
Result if Git installedgit version 2.50.0.windows.1
Link : Flutter Github
Installing Flutter on Windows
To create Flutter CodeLabs, you need to download the Flutter SDK. Download the installation bundle to get the latest stable release of the Flutter SDK. Extract the ZIP file and place the contained flutter folder in your desired installation location (for example, C:\src\flutter).
Link: Flutter Get SDKUpdate Environment Variable Path
It is good practice for a Flutter developer to update the Environment Variables , specifically the Path on Windows because it allows your system to recognize and run Flutter commands from any directory in the Command Prompt, PowerShell, or terminal.
Follow these steps to add Flutter to the PATH environment variable.- From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
- Under User variables check if there is an entry called Path:
- If the entry exists, append the full path to flutter\bin using ; as a separator from existing values.
- If the entry doesn’t exist, create a new user variable named Path with the full path to flutter\bin as its value.
- Close and reopen any existing console windows for these changes to take effect.
Run the following command to see if there are any platform dependencies you need to complete the setup.
C:\src\flutter>flutter doctor
The above command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.32.4, on Microsoft Windows [Version 10.0.22631.5039], locale en-IN)
[√] Windows Version (11 Pro 64-bit, 23H2, 2009)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Enterprise 2019 16.11.23)
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop
development with C++" workload, and include these components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[!] Android Studio (not installed)
[√] VS Code (version 1.87.1)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 3 categories.
There are two errors in the results above — one related to the Android SDK and the other due to missing necessary components (such as the Dart plugin) in Visual Studio Code. Both issues are associated with the editor and its dependency libraries, and they need to be resolved during the editor installation; otherwise, we may encounter the errors shown below while debugging the source code. We will address these issues during the installation process.
Launching lib\main.dart on Windows in debug mode...
Error: Unable to find suitable Visual Studio toolchain. Please run `flutter doctor` for more details.
Exited (1).
Popular Flutter Editors
A Flutter application can also be built using any text editor in combination with Flutter’s command-line tools. However, Google recommends using one of the following editor plugins for a better development experience. These plugins offer features such as code completion, syntax highlighting, widget editing assists, run and debug support, and more.- Visual Studio Code (VS Code)
- Android Studio and IntelliJ
- Emas
Install Visual Studio Code (VSCODE FLUTTER)
Many Flutter developers prefer Visual Studio Code for its lightweight interface. Follow these steps to configure Visual Studio Code for Flutter development.
- Install VS Code.
To work with flutter in VSCODE you need to install and configure the VS code. Download the VS Code setup file from the link given below and install it. Only 5 easy steps you need to follow to install it.
Link: Flutter VSCode - Configure flutter in VScode.
- Start VS Code.
- Invoke View > Command Palette….
- Type “install” and select Extensions: Install Extensions.
- Type “flutter” in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.
Summary
Setting up the Flutter development environment is straightforward if you follow each step carefully. Once configured, you'll have a powerful cross-platform development toolkit at your fingertips, allowing you to build stunning UIs and performant applications from a single codebase. I hope it was helpful to you.
Thanks