Flutter Installation

Before learning to build Flutter applications, you need to install the Flutter SDK and all required dependencies on your local machine. This section will detail the installation steps on Windows, macOS, and Linux systems.


System requirements

Before installing Flutter, ensure your development environment meets the following basic requirements:

RequirementsWindowsmacOSLinux
Operating systemWindows 10 or latermacOS 10.14 or laterUbuntu 18.04 or later
Disk spaceAt least 2.8 GBAt least 2.8 GBAt least 2.8 GB
ToolsGit for WindowsGit (via Xcode)Git、curl、unzip

Windows Installation Steps

Step 1: Install Git for Windows

Git is a version control tool, and Flutter needs it to manage code and download the SDK.

  1. VisitGit for Windows download page
  2. Download the latest version of Git for Windows
  3. Run the installer and complete the installation using the default settings

Step 2: Install Visual Studio Code (Recommended)

Visual Studio Code (VS Code) is our recommended editor for Flutter development, offering rich Flutter extension support.

  1. VisitVS Code official website
  2. Download and install VS Code
  3. After installation, open VS Code.

Step 3: Install Flutter SDK

There are two ways to install the Flutter SDK:

Method 1: Install using VS Code (Recommended)

The Flutter extension for VS Code can automatically download and configure the Flutter SDK.

  1. In VS Code, click the Extensions icon on the left (or press Ctrl+Shift+X)
  2. Search "Flutter" and find the "Dart and Flutter extensions" extension
  3. Click "Install" to install the extension.
  4. After installation, press Ctrl+Shift+P to open the command palette.
  5. Type "Flutter: New Project" and select
  6. Select "Download SDK", then choose the installation directory

Method 2: Manually download and install

  1. VisitFlutter official website download page
  2. Download the latest Flutter SDK (.zip file)
  3. Extract the downloaded file to a directory of your choice, e.g., C:\flutter
  4. Add the Flutter bin directory to the system environment variable PATH

Manually configure environment variables

Steps to configure environment variables on Windows:

  1. Right-click "This PC" and select "Properties".
  2. Click "Advanced system settings"
  3. Click "Environment Variables"
  4. In "System Variables", find Path and click "Edit".
  5. Click "New" and add the Flutter bin directory path (e.g., C:\flutter\bin)
  6. Click OK to save

macOS Installation Steps

Step 1: Install Git

macOS usually comes with Git pre-installed. You can check with the following command:

$ git --version

If not installed, run the following command:

$ xcode-select --install

After the dialog box appears, click the "Install" button.

Step 2: Install VS Code

fromVS Code official websiteDownload and install VS Code.

Step 3: Install Flutter SDK

Similar to Windows, you can choose to install from VS Code or manually.

Manual installation steps:

  1. Download Flutter SDK:
$ git clone https://github.com/flutter/flutter.git -b stable
  1. Add Flutter to PATH:
$ echo 'export PATH="$PATH:/Users/你的用户名/flutter/bin"' >> ~/.zshrc
$ source ~/.zshrc

Linux Installation Steps

Step 1: Install necessary tools

On Ubuntu/Debian systems, run the following command to install the necessary tools:

$ sudo apt-get update
$ sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa

Step 2: Clone the Flutter SDK

$ git clone https://github.com/flutter/flutter.git -b stable

Step 3: Configure PATH

$ echo 'export PATH="$PATH:$HOME/flutter/bin"' >> ~/.bashrc
$ source ~/.bashrc

Verify Installation

Regardless of which operating system you use to install Flutter, you can verify the installation with the following command:

$ flutter doctor

After running this command, Flutter will check your development environment and report any issues. If the installation succeeds, you will see output similar to the following:

Doctor summary (v3.x.x):
[✓] Flutter (Channel stable, 3.x.x)
[✓] Android toolchain
[✓] iOS toolchain
[✓] Chrome (for web development)
[✓] Windows toolchain
[✓] macOS toolchain
[✓] Linux toolchain
[✓] Web server

On the first run of flutter doctor, it will download the Dart SDK and perform some initialization operations, which may take a few minutes.


Troubleshooting common issues

Flutter command not found

If the flutter command is not found in the terminal, check:

  • Whether the PATH environment variable is correctly configured.
  • Whether a new terminal window was opened (environment variable changes require a new window to take effect).

Android Studio not installed warning

When running flutter doctor, a warning may appear indicating that Android Studio is not installed. If you are not developing Android apps, you can ignore this warning.

Android SDK issues

If you need to develop Android apps but encounter SDK issues, you can:

  1. Download and installAndroid Studio
  2. In Android Studio, install the Android SDK via SDK Manager
other extensions