Android studio configures the Flutter development environment
Table of contents
Used to[TOC]
generate the directory:
1. System requirements
- OS: Windows 7 or later (64-bit)
- Disk space: 400 MB (not including disk space for Android Studio).
Tools: Flutter depends on these command line tools being available in your environment.
[ Git for Windows ] (use Git in the Windows Command Prompt option)If you have Git for Windows installed, make sure you can run git commands from Command Prompt or PowerShell.
Emphasis does not support Git BashGet the Flutter SDK
Before getting the Flutter SDK , you need to download the git client . To get Flutter, use git to clone the repository, then add the flutter tool to your path. Running flutter doctor will show you any remaining dependencies you may need to install.
2. Configure environment variables, which is an essential step in China at present
If you are installing or using Flutter in China , it may be helpful to use a reliable local mirror site that hosts Flutter dependencies. To instruct the Flutter tools to use an alternate storage location, you need to set two environment variables, PUB_HOSTED_URL and FLUTTER_STORAGE_BASE_URL before running the flutter command.
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
git clone -b dev https://github.com/flutter/flutter.git
export PATH="$PWD/flutter/bin:$PATH"
cd ./flutter
flutter doctor
There are also git environment variables, please configure them in PATH
3. Download flutter SDK in CMD
2. In this step, download the flutter project through git 3. Find the flutter\bin directory to download flutter doctor 4. Download the successful picture
4. Open Android studio to download flutter and dart plugins
5. Create a new flutter project,
If the project cannot be created, restart or log off the computer