[] Flutter Flutter development environment to build (Android Studio at Flutter / Dart plug-in installation | Flutter SDK installation | environment variable configuration | Development Environment inspection)



I. Flutter learning materials



Flutter learning materials:


① official document: https://flutter.dev/docs

② Flutter Android developer documentation: https://flutter.dev/docs/get-started/flutter-for/android-devs

② Flutter plug-in library: https://pub.dev/



II. Flutter development environment to build



Flutter development environment to build:


Android Studio ①: https://developer.android.google.cn/studio , requires 3.0 or later; Google provides Android development environment;

② Windows PowerShell 5.0: recommended to use Win10 (the pre-installed), new command-line tools, cmd (command prompt) has been extended;

Git ③: https://git-scm.com/download/win , code management tool, you can install the latest version;



III. Android Studio environment installation Flutter / Dart plug



. 1 Flutter search plugin installed: Android Studio menu bar -> File -> Settings -> Plugins, search Flutter plug in the Marketplace, click on the Install button to install;

Here Insert Picture Description


2. Click Install to install: will be prompted to rely on third-party plug-ins, you need to install the plug-Dart, Dart here need to install plug-ins;


3. accept the installation of third-party plug-ins:

Here Insert Picture Description


4 Install the plug-Dart:
Here Insert Picture Description

. 5 Flutter / Dart plug-in installation is complete:

Here Insert Picture Description


6. Restart Android Studio: After installation, restart Android Studio plug-ins to take effect;



IV. Download Flutter SDK



1. Download Flutter SDK: If the official download link to download is too slow, please download the following Chinese mirror download link ;


2. Download: https://flutter.dev/docs/development/tools/sdk/releases , select the stable version of the latest version can be; (official link, the download speed may be slow)

Here Insert Picture Description


3. Mirror Download address generation: the need to replace the domain name to obtain the latest address to manually download mirror;


① Generate Mirror Download: link to the official website of the basic fixed under in China, the use of storage.flutter-io.cnthe domain name to replace the download link in the storage.googleapis.comdomain can use the mirror link to download the latest version; (this address current needs its own generation)


② official download link: https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_v1.12.13+hotfix.8-stable.zip is currently the latest Flutter SDK download address, do not move at this link, use use storage.flutter-io.cnthe domain name to replace the download link in the storage.googleapis.comdomain, namely the following image Download;


③ Mirror Download: https://storage.flutter-io.cn/flutter_infra/releases/stable/windows/flutter_windows_v1.12.13+hotfix.8-stable.zip , the address to download quickly, if the latest version, you can generate a new image-replaceable Download;



V. Set Flutter network mirror (Chinese domestic recommended setting)



1. Mirror address lookup: In https://flutter.dev/community/china check the latest Flutter Chinese mirror address of the page;


2 is the most current image: The following two mirror address provided to the environment variable;

FLUTTER_STORAGE_BASE_URL: https://mirrors.sjtug.sjtu.edu.cn/
PUB_HOSTED_URL: https://dart-pub.mirrors.sjtug.sjtu.edu.cn/

If you set up at home or look better, it could save a lot of things;



VI. Flutter set environment variables (variables in the system configuration)



1. Configuration Flutter environment variable: i.e. above flutter_windows_v1.12.13 + download the file decompression hotfix.8-stable.zip bin directory, Path environment variable in the configuration;

D:\001_Programs\004_Flutter\flutter\bin

Here Insert Picture Description


2. Configure site resources mirroring environment variables:

变量名(N):FLUTTER_STORAGE_BASE_URL
变量值(V):https://mirrors.sjtug.sjtu.edu.cn/

Here Insert Picture Description

变量名(N):PUB_HOSTED_URL
变量值(V):https://dart-pub.mirrors.sjtug.sjtu.edu.cn/

Here Insert Picture Description

3 Configure Android SDK environment variables in the specified format:


① configure Android SDK path: it must first configure ANDROID_HOME environment variables, configuration content is the root of the Android SDK;

变量名(N):ANDROID_HOME
变量值(V):D:\001_Programs\001_Android\002_Sdk\Sdk

Here Insert Picture Description


② arranged Android SDK environment variables related to: the need in the Path environment variable, configure emulator, platform-tools, tools address; format are

%ANDROID_HOME%\emulator
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\tools

Here Insert Picture Description



VII. Flutter environment variable inspection



1. Check the environment: After the above operation, executing flutter doctor command to check Flutter development environment; the first run command relatively long time consuming 5 to 10 minutes or more, to wait;

Here Insert Picture Description

2. All agreed License: According to the above prompt, performing flutter doctor --android-licenses command, all agree to the license agreement, can be detected by;
Here Insert Picture Description

Published 291 original articles · won praise 1034 · Views 1.69 million +

Guess you like

Origin blog.csdn.net/han1202012/article/details/104825048