I wrote earlier about installing Flutter on Mac. I found a Windows PC to write this article because a friend suggested that I need a Windows installation process

The process of installing Flutter on Windows is extremely simple. Let’s get started

The native environment

  • System: Windows 10 X64
  • Memory: 8 g

System requirements

To install Flutter on Windows, the following conditions must be met:

  • System: Windows 7 or later (64-bit)
  • Storage: not less than 400 MB

That’s all the system requires, and two more tools need to be installed

  • PowerShell 5.0 or later

  • Git for Windows

    If you don’t have PowerShell, you can download and install it yourself

    For Git installation, it is also relatively simple, if not, please refer to this tutorial: installing Git 2.10.2 on Windows10

Installing the SDK

After the preparatory work was completed, we started to install the Flutter

Download the SDK

Flutter_windows_v0. 5.1 beta. Zip

Download Flutter V0.5.1 via the link above. This is the latest version of Flutter. If you need to download other versions of Flutter, or if you read this article later, you can download flutter from the official SDK archive page

flutter sdk archive

Once the download is complete, we unzip the folder to get the Flutter folder. This is our SDK. Let’s find a place to store it. I choose to store D:\ Flutter

When selecting the folder to store the FLUTTER, it is important to note that you cannot select the folder with permissions to store the SDK. This can cause a number of problems

Execute batch files

Once the folder is saved, open the flutter folder and double-click on the batch file flutter. Bat in the bin directory (D:\flutter\bin).

Setting environment Variables

Let’s find the system environment variable PATH and click Edit

Select New and enter the full path of your flutter/bin directory D:\flutter\bin. After saving, your system variable list should look like this

Because some of the commands of flutter need to be connected to the Internet, we need to make a simple setup for Using flutter in China.

Let’s go ahead and set two environment variables

PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
Copy the code

Next we open the command line and run the command flutter to check that the flutter is properly installed

If you have any of the above output, congratulations on your SDK installation and the first step of the Great Wall. You deserve a beer

Configuration depends on

Although the SDK installation is complete, there are some other dependencies that need to be installed.

Let’s execute the Flutter Doctor and it will automatically do the dependency checks for us

PS C:\Users\Administrator> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.17134.165], locale zh-CN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOMEto that location. [X] Android Studio (not installed) [!]  Connected devices ! No devices available ! Doctor found issuesin 3 categories.
PS C:\Users\Administrator>

Copy the code

Flutter has given us a list of problems and solutions.

I used a clean computer to write this article, and if you don’t have the Android SDK and Android Studio installed on your computer, you should see the same error messages I did.

We follow the tips to install Android SDK and Android Studio, because the installation is quite simple, we refer to the Android Studio installation tutorial -win10- complete the latest version of their own installation can be

Configuration editor

When we install the Android SDK and Android Studio and execute flutter Doctor again, we find that there are still problems that need to be solved

PS C:\Users\Administrator> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, V0.5.1, on Microsoft Windows [Version 10.0.17134.165], locale zh-CN) [!]  Android toolchain - developforAndroid Devices (Android SDK 28.0.1) X Android licenses not accepted. To resolve this, run: [√] Android Studio (Version 3.1) X Flutter Plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [!]  Connected devices ! No devices available ! Doctor found issuesin 2 categories.
Copy the code

Android licenses not accepted

Flutter provides a solution to Android Licenses by executing the following command and then entering Y all the way

flutter doctor --android-licenses
Copy the code

Flutter plugin not installed and Dart plugin not installed

Android Studio does not install the Flutter plugin or Dart plugin

Let’s open Android Studio, click Plugins, select Browse Repositories, and search for Folders to install. While installing Folders, the Editor will also install the Dart plugin for us

When we’re done installing, let’s restart Android Studio and complete the editor configuration

Start the Flutter

Let’s turn it back onAndroid Studio, the choice ofStart a new Flutter project

chooseFlutter Application

The project name and storage location can be customized

In this step, enter the name of the company or organization

Finally, click Finish and the project opens with the following directory structure

For these directory structures. We’ll talk about that later

When we create a new project, Flutter generates a Demo App that lets us run the Demo

Configuring the Emulator

Let’s choose Tools > AVD Manager to create a new emulator

Select a device and click Next

Select a system image and click Download

Wait for the download and installation to complete, and finally it will be displayed in the device bar

Let’s select this device and hit Run. Waiting for the simulator to run

Ok. A Demo App was launched where we could modify the contents of Main. dart to experience the hot loading of the Flutter

Incurable diseases

  1. emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable. CPU acceleration status: HAXM is not installed on this machine

Solution: Choose Tools > SDK Manager > SDK Tools and install HAXM

The end of the

From installation to DEMO launch, we have experienced the first step of Flutter. The first step has already been taken, and the 100th step will not be far away

This is the end of this article, and the series has just begun

If you find any typos in this article, please correct them in the comments. Thank you

Communication QQ group: 826912082 column: segmentfault.com/blog/enda