How to Install Flutter on Windows: Step-by-Step Guide
Flutter is a popular open-source UI software development kit (SDK) created by Google. It is used to develop cross-platform applications for Android, iOS, Linux, macOS, Windows, Google Fuchsia, and the web from a single codebase. This guide will walk you through the process of installing Flutter on a Windows machine.
Step 1: System Requirements
Before you start, ensure that your system meets the following requirements:
- Operating System: Windows 10 or later (64-bit)
- Disk Space: 1.64 GB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these tools being available in your environment.
- Git for Windows
- PowerShell 5.0 or newer (this is pre-installed with Windows 10)
- Windows Subsystem for Linux (optional, useful for additional development tools)
Step 2: Download the Flutter SDK
- Download the Flutter SDK
- Go to the Flutter website.
- Click on the ‘Download Flutter SDK’ button to download the latest stable version of Flutter.
2. Extract the Flutter SDK
- Locate the downloaded
flutter_windows_<version>-stable.zip
file in your Downloads folder. - Right-click on the ZIP file and select ‘Extract All…’.
- Choose a location for the Flutter SDK (e.g.,
C:\src\flutter
). Ensure that the path does not contain any special characters or spaces.
Step 3: Update Your System Path
To run the Flutter commands from any terminal window, you need to add the Flutter SDK to your PATH environment variable.
- Open Environment Variables
- Press
Win + S
to open the search bar and type 'env'. - Select ‘Edit the system environment variables’.
2. Edit Environment Variables
- In the System Properties window, click on the ‘Environment Variables…’ button.
- Under ‘System variables’, find the
Path
variable and select it. Click 'Edit...'.
3. Add New Path
- Click ‘New’ and add the path to the
flutter\bin
directory (e.g.,C:\src\flutter\bin
). - Click ‘OK’ to close all windows.
Step 4: Install Git for Windows
Flutter relies on Git for some operations, so you need to install Git.
- Download Git for Windows
- Go to the Git for Windows website.
- Click on ‘Download’ to get the latest version.
2. Install Git
- Run the downloaded installer and follow the installation prompts. Use the default settings.
Step 5: Run Flutter Doctor
- Open Command Prompt
- Press
Win + S
to open the search bar and type 'cmd'. Press Enter to open the Command Prompt.
2. Run Flutter Doctor
- In the Command Prompt, type the following command and press Enter:
- This command checks your environment and displays a report of the status of your Flutter installation. It also checks for any additional software that you might need to install or update.
Step 6: Install Android Studio
- Download Android Studio
- Go to the Android Studio download page.
2. Install Android Studio
- Run the downloaded installer and follow the installation prompts.
3. Set Up Android Studio
- Open Android Studio.
- Go to ‘Configure’ > ‘SDK Manager’.
- Ensure that the ‘Android SDK’ is installed.
- Install the ‘Android SDK Command-line Tools’.
4. Set Up Android Virtual Device (AVD)
- Go to ‘Configure’ > ‘AVD Manager’.
- Create a new virtual device and follow the prompts to set it up.
Again run “flutter doctor” command, you will need to accept android licenses
You can run this command “flutter doctor — android-licenses” and then press “y” to accept all the licenses.
Step 7: Install Visual Studio Code
- Download Visual Studio Code
- Visit the Visual Studio Code website.
- Download and install VS Code.
2. Install Flutter and Dart Extensions
- Open VS Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or pressing
Ctrl + Shift + X
. - Search for ‘Flutter’ and install the Flutter extension by Dart Code.
- The Dart extension will be installed automatically with the Flutter extension.
Step 8: Connect Your Android Device via USB
- Enable Developer Options and USB Debugging on Your Android Device
- Go to ‘Settings’ > ‘About phone’.
- Tap ‘Build number’ seven times to enable Developer Options.
- Go back to ‘Settings’ > ‘System’ > ‘Developer options’.
- Enable ‘USB debugging’.
2. Connect Your Android Device to Your Computer
- Use a USB cable to connect your Android device to your computer.
- If prompted, allow USB debugging from your computer on your Android device.
Step 9: Create and Run a Flutter Project in VS Code
- Create a New Flutter Project
- Open VS Code.
- Press
Ctrl + Shift + P
to open the Command Palette. - Type ‘Flutter: New Project’ and select it.
- Enter a name for your project and choose a location to save it.
2. Run the Flutter Project
- Open the main Dart file, usually located at
lib/main.dart
. - Press
F5
to start debugging. - In the status bar, you should see your connected device listed. Select it.
- The Flutter app will be built and deployed to your connected Android device.
Step 10: Install Useful Extensions for Flutter Development in Visual Studio Code
- Material Icon Theme
- Prettier Code formatter
- Tabnine
- Flutter Auto Import
- Awesome Flutter Snippets
- Pubspec Assist
- Pubspec dependency search
Conclusion
Congratulations! You’ve successfully set up Flutter with Visual Studio Code and connected your Flutter app to an Android device via USB connection. You can now start building and testing your Flutter apps directly on your Android device.
LinkedIN — https://www.linkedin.com/in/dhananjay7
Buy Me a Coffee — https://www.buymeacoffee.com/dhananjay7781
Follow me on GitHub — https://github.com/dhananjay7781