Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Flutter Installation

Flutter Installation

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


System Requirements

Before installing Flutter, please make sure your development environment meets the following basic requirements:

Requirement Windows macOS Linux
Operating system Windows 10 or later macOS 10.14 or later Ubuntu 18.04 or later
Disk space At least 2.8 GB At least 2.8 GB At least 2.8 GB
Tool Git for Windows Git (via Xcode) Git、curl、unzip

Windows Installation Steps

Step 1: Install Git for Windows

Git is a version control tool that Flutter uses to manage code and download the SDK.

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

Step 2: Install Visual Studio Code (Recommended)

Visual Studio Code (VS Code for short) is our recommended editor for Flutter development; it provides rich Flutter extension support.

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

Step 3: Install the 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. Click the extensions icon on the left in VS Code (or press Ctrl+Shift+X)
  2. Search for "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 it
  6. Select "Download SDK", then choose the installation directory

Method 2: Manual download and installation

  1. Access the Flutter official download page
  2. Download the latest Flutter SDK (.zip file)
  3. Extract the downloaded file to a directory of your choice, such as C:\flutter
  4. Add Flutter's 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. Find Path in "System variables" and click "Edit"
  5. Click "New" and add the path to Flutter's bin directory (such as C:\flutter\bin)
  6. Click OK to save

macOS Installation Steps

Step 1: Install Git

macOS usually comes with Git preinstalled; you can check with the following command:



$ git --version

If it is not installed, run the following command:



$ xcode-select --install

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

Step 2: Install VS Code

From the VS Code official website Download and install VS Code.

Step 3: Install the Flutter SDK

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

Manual installation steps:

  1. Download the 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 Required Tools

On Ubuntu/Debian systems, run the following command to install the required 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 the installation

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



$ flutter doctor

After running this command, Flutter will check your development environment and report any issues. If the installation is successful, 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

The first time you run flutter doctor, it will download the Dart SDK and perform some initialization, which may take a few minutes.


Common Problem Solutions

Flutter Command Not Found

If entering the flutter command in the terminal shows it is not found, please check:

Android Studio Not Installed Warning

When running flutter doctor, you may see a warning that Android Studio is not installed. If you do not develop Android apps, this warning can be ignored.

Android SDK Issues

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

  1. Download and install Android Studio
  2. Install the Android SDK through SDK Manager in Android Studio