An afternoon to write a simple development environment to build Flutter, dome up and running!

1. Download flutter package due to the need FQ, the country will have problems to download, all you need to configure what user environment variables.

export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

Configure the user environment variables: Right-click My Computer > Properties > Advanced System Settings, then there will be user environment variables blocks (do not set the system variable).

 

 

2. In git installed on Flutter SDK . (Use code will soon address the cloud, but I did not write down the address)

git command: git clone -b dev https://github.com/flutter/flutter.git

 

3. Next win + R & lt , input cmd , enter the command  Flutter Doctor , to install its dependencies.

 

 

出现上图所示的情况,说明正在安装,由于是第一次使用flutter命令,所有需要等一段时间,以后再运行就会快得多。安装成功后会显示如下图(打勾代表正确, X 达代表有问题, ! 代表要需要安卓studio以及连接的设备,那么现在我们主要需要安装的就是安卓sdk了,也就是说,flutter sdk已经安装OK):

 

 

4.接下来安装 android studio,安装完成后再到cmd 命令行执行 flutter doctor。(如果一切顺利,那么android studio前面应该是一个对勾)。

 

5.接下来在cmd输入命令:flutter doctor --android-licenses,然后一路按“y”

 

6.最后再在cmd命令行执行flutter doctor

 

7.可以使用vscode创建一个app项目,ctrl+shift+p选择FlutterNew Project,然后输入项目名字,选择创建的目录,即可看见一个新创建的项目文件夹。

 

使用VScode调试flutter项目,使用android studio开启模拟器。

1.vscode android studio 都要安装flutter插件(安装flutter时,dart默认就一块安装)。

2.点击下图图标,添加android模拟器类型

 

3.然后打开flutter项目中找到main.dart文件,然后点击下图图标,运行。

 

4.android studio配置完成后,这时模拟器已可用,在vscode中,按F5就会唤起模拟器,直接可以使用vscode调试代码。

Guess you like

Origin www.cnblogs.com/lcr-smg/p/11202616.html