欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在windows上搭建flutter开发环境

程序员文章站 2022-05-29 20:24:16
...

1.先搭建安卓的开发环境,这个就不多少了

2.下载flutter的SDK,放到你想要放的文件夹中,我一般都是在D盘中新建flutterSDK文件件放置

下载链接https://flutter.dev/docs/development/tools/sdk/releases#windows 取最新版本下载

3.在Flutter安装目录的flutter文件下找到flutter_console.bat,双击运行并启动flutter命令行,接下来,你就可以在Flutter命令行运行flutter命令了

4.进行Flutter doctor 的测试

输入  flutter doctor  按回车键,大概有下面的数据,就可以了

D:\flutter\flutter_windows\flutter>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.17134.1069], locale zh-CN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

[√] Android Studio (version 3.4)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

5.在studio上新创建一个flutter项目:

在windows上搭建flutter开发环境

接下来

在windows上搭建flutter开发环境

接下来下一步一直往下点:

在windows上搭建flutter开发环境

 

点击完成这时候已经完整的创建好一个项目了,不过先别高兴,运行的时候可能还会有问题,先关联Android的SDK,如下:

在windows上搭建flutter开发环境

接下爱可能会出现gradle的版本问题,解决如下:

在windows上搭建flutter开发环境

其他的版本问题可以在这里改:

在windows上搭建flutter开发环境

都可以改成自己想要的,符合目前的开发版本。