Add system environment variables

Domestic access to FLUTTER is sometimes restricted, so domestic users need to use an image. Add the following system environment variables to flutter:

  1. PUB_HOSTED_URL: pub. Flutter – IO. Cn

storage.flutter-io.cn

Access to Flutter the SDK

Preparing Git tools

Git for Windows

Flutter SDK download

  1. Download the flutter SDK with git command:
git clone -b master https://github.com/flutter/flutter.git
Copy the code
  1. Set the FLUTTER environment variables

Create the full Path of the system environment variable Path: flutter\bin as its value

  1. Set the ANDROID_HOME environment variable

Create the system environment variable ANDROID_HOME with the value of android SDK

Restart Windows to apply this change

Run the flutter doctor

Open a new command prompt or PowerShell window and run the following command to see if any dependencies need to be installed to complete the installation

 flutter doctor
Copy the code

The first time a flutter command (such as a flutter Doctor) is run, it downloads its own dependencies and compiles them. It will run much faster later.

Install the android studio

Select the appropriate operating system to install Android Studio

Set the SDK storage path

Plug-in download

  1. Download the Flutter plugin

Create a project

You can create it in either of two ways:

  1. Editor creation
  2. Command line creation
flutter create myapp
Copy the code
  1. Select the connected device (real or emulator), if the mobile device is not detected, refer to this article for configuration (portal)

Start the project

Run the following command on the terminal:

flutter run
Copy the code

Wait for the project to start.

Pay attention to the point

  1. Debug mode should be enabled in advance.
  2. The first startup takes a long time, possibly up to 10 minutes