How to Install Flutter in VS Code (Windows, macOS, and Linux)
Flutter is a powerful framework for building cross-platform mobile, web, and desktop applications. This guide will walk you through the installation of Flutter in Visual Studio Code (VS Code) on Windows, macOS, and Linux.
Step 1: Install Flutter SDK
Windows
1. Download Flutter
-
Go to the official Flutter website: Flutter SDK
-
Download the latest Windows version (
flutter_windows.zip
).
2. Extract and Set Up Flutter
-
Extract the ZIP file to
C:\flutter
(or any location of your choice). -
Add Flutter to the system Path:
-
Open Start Menu and search for
Environment Variables
. -
Select Edit the system environment variables.
-
Under System Variables, select
Path
and click Edit. -
Click New, and add:
C:\flutter\bin
-
Click OK and restart your computer.
-
3. Verify Installation
Open the Command Prompt (cmd) and run:
flutter --version
macOS
1. Download and Install Flutter
-
Visit Flutter SDK
-
Download the macOS Flutter SDK (
flutter_macos.zip
). -
Open Terminal and run:
cd ~/Downloads unzip flutter_macos_*.zip
-
Move Flutter to
/usr/local
:sudo mv flutter /usr/local/
2. Add Flutter to Path
nano ~/.zshrc
Add the following line:
export PATH="$PATH:/usr/local/flutter/bin"
Save and apply changes:
source ~/.zshrc
3. Verify Installation
flutter --version
Linux
1. Download Flutter
-
Go to Flutter SDK
-
Download
flutter_linux.tar.xz
.
2. Extract and Set Up Flutter
cd ~/Downloads
sudo tar -xf flutter_linux.tar.xz -C /usr/local
3. Add Flutter to Path
echo 'export PATH="$PATH:/usr/local/flutter/bin"' >> ~/.bashrc
source ~/.bashrc
4. Verify Installation
flutter --version
Step 2: Install Dependencies
Windows
-
Install Git: Download Git
-
Install Android Studio: Download
-
Install Android SDK and accept licenses:
flutter doctor --android-licenses
macOS
-
Install Xcode:
xcode-select --install sudo xcodebuild -runFirstLaunch
-
Install CocoaPods:
sudo gem install cocoapods
-
Install Android Studio and SDK as above.
Linux
-
Install dependencies:
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
-
Install Android Studio and SDK as in Windows.
Step 3: Install VS Code and Flutter Extensions
1. Install VS Code
-
Download and install VS Code.
2. Install Flutter and Dart Extensions
-
Open VS Code.
-
Go to Extensions (
Ctrl + Shift + X
orCmd + Shift + X
on Mac). -
Search for Flutter and install it (this will also install Dart).
Step 4: Verify Installation
Run:
flutter doctor
If everything is set up correctly, you should see ✓ for all components.
Step 5: Create and Run a Flutter Project
flutter create my_app
cd my_app
code .
-
Open the project in VS Code.
-
Press
F5
to run the app.
You’re All Set!
Now you can start developing Flutter apps in VS Code. Let us know if you need any help!