flutter 开发环境

-------------------------------------------------
学习网站
https://flutter.cn/docs/get-started/install/windows
-------------------------------------------------
0,设置flutter源,安装Git-2.27.0-64-bit,获取Flutter-SDK。
    0.1    环境变量(用户变量)
        PUB_HOSTED_URL=https://pub.flutter-io.cn
        FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
    0.2,    git clone https://github.com/flutter/flutter.git  
1,默认安装JDK(jdk-8u261-windows-x64)
    JDK环境变量(系统变量)
    JAVA_HOME=C:\Program Files\Java\jdk1.8.0_261
    Path:
    %JAVA_HOME%\bin
    %JAVA_HOME%\jre\bin
2,安装Flutter-SDK,并运行flutter.bat脚本
    Flutter-SDK环境变量(系统变量)
    Path:
    D:\soft\FlutterApp\FlutterSDK\flutter\bin
3,安装android-studio(包括android-SDK,fullter,dart)
4,重启
5,测试flutter doctor  package get

flutter doctor --android-licenses

6,安装vscode

7,创建Flutter项目
注意设置java SDK目录
打开vscode,按下 shift+ctrl+p,输入flutter

第一次使用flutter run 运行项目时会更新下载一些组件,比较耗时,要耐心等待

Flutter\flutter_sdk\packages\flutter_tools\gradle
https://services.gradle.org/distributions/
解决 
Go to flutter_app => android => gradle => wrapper directory
Delete gradle-wrapper.jar file
Open and edit gradle-wrapper.properties file
Change distributionUrl=https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-5.4.1-all.zip or latest
On terminal use flutter run command

 

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页