Configure Flutter SDK environment under Windows

Configure Flutter SDK environment under Windows

1. System configuration requirements

  • Operating system : Windows 7 SP1 or higher (64-bit operating system).

  • Disk space : In addition to installing IDE and some tools, there should be at least 1.32 GB of space.

  • Tools : To allow Flutter to be used normally in your development environment, rely on the following tools:

    • Windows PowerShell 5.0  or higher (it is pre-installed in Windows 10, and there is basically no problem with win7)

    • Git for Windows  2.x, and check the  option to use Git from the Windows command prompt .

      If the Windows version of Git has already been installed, make sure you can execute the git command directly from the command prompt or PowerShell.

2. Download the SDK compression package

  1. Through this link to download the Flutter SDK archive: Flutter SDK download ( Memo  : Please note that a similar decompression tool such as 7-Zip is not decompressed by default hidden files, which may cause you to download Flutter SDK is incomplete, So you can choose other decompression tools to decompress).
  2. Unzip the compressed package, and then put the  flutter entire directory in the Flutter SDK installation directory you expected (for example  C:\src\flutter; do not put the directory in some directories that require additional operation permissions, for example  C:\Program Files\).

3. Configure the Path environment variable of the system

(1) Configure two mirrors, otherwise when you create a Flutter project with AndroidStudio, you will always be in a waiting state due to network reasons, as shown in the figure

Two environment variables that need to be configured

变量名:FLUTTER_STORAGE_BASE_URL
变量值:https://storage.flutter-io.cn

变量名:PUB_HOSTED_URL
变量值:https://pub.flutter-io.cn

(2) Add the path of the Flutter SDK (for example: C:\mySoft\flutter\bin) to the Path environment variable of the system

4. Run the test

flutter doctor

Enter flutter doctor in the command line operation window to test. The above command will check your existing environment, and then present the test results in the form of a report. Read the content it displays carefully and check if there is software that has not been installed or other steps to complete (usually presented in bold ).

5. AndroidStudio installs the Flutter plug-in (that is, what the results of running flutter doctor said above)

If Dart is not installed before installation, the following will be prompted

After the installation is complete, restart AndroidStudio. Then you can create a Flutter project.

Select the type of Flutter project to create, here select Application

Set the project name, the SDK path of the project (the SDK path decompressed before) and the storage address of the project

Article reference:

Install and configure the Flutter development environment on the Windows operating system ( reference link ): " https://flutter.cn/docs/get-started/install/windows "

Guess you like

Origin blog.csdn.net/nsacer/article/details/108804641