Configure the Flutter development environment under Windows

Install Git

You need to install Git as a download tool for the Flutter SDK.

Installation tutorial: http://blog.csdn.net/johnwcheung/article/details/53090728

Download Flutter SDK

Right-click git base here on the Windows desktop (of course, you can also select a folder to open the git command line window), and enter the following command to download the Flutter SDK:

git clone -b beta https://github.com/flutter/flutter.git

Note: The download path of Flutter must be in English and the path cannot contain spaces! The download path of Flutter must be in English and the path cannot have spaces! The download path of Flutter must be in English and the path cannot have spaces!

Configure environment variables

You need to add the path of flutter in the Windows environment variable Path. The path points to the bin path of the Flutter file as shown below:

write picture description here

Install

Open PowerShell (Admin) and enter the following commands:

flutter doctor

Flutter will automatically configure the installation. After success, you will see the following interface:

write picture description here

Configure the IDE

You need to install Android Studio 3.0 and above and Android SDK, you don't need to reinstall if you have it before.

Next, we need to install two plugins, Dart and Flutter, where dart is used for code analysis, and flutter is used for project compilation and other work:

  • Go to the Plugins settings module in Settings, click Browse repositories, find dart and flutter and install them.

write picture description here

write picture description here

write picture description here

  • Then configure the sdk paths for dart and flutter in Languages ​​& Frameworks in Settings. The sdk path refers to your machine. At this point, the basic configuration of Flutter's development environment is complete.

write picture description here

write picture description here

Attachment: Command line debugging and compilation

  1. Pack

    • debug: flutter run –d(如果有多个设备,要指定目标设备)
      Note: There is a slowmode logo in the upper right corner of the application packaged in debug mode
    • release:flutter run --release
  2. debugging

    • Code Analysis:flutter analyze
    • Test application startup time:flutter run --trace-startup –profile

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325768389&siteId=291194637