Windows10搭建Flutter桌面应用环境

本文尝试搭建Windows10下的Flutter for Windows桌面应用,记录步骤以及遇到的坑,方便参考。

配置国内镜像源

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

Windows10搭建Flutter桌面应用环境

下载:flutter_windows_v1.12.13+hotfix.8-stable.zip

.\flutter\bin添加到系统环境变量Path

flutter doctor检查版本

更新到主线版本:可能会比较慢,耐心等待

flutter channel master

flutter upgrade

再次执行flutter doctor检查环境

设置环境变量:ENABLE_FLUTTER_DESKTOP = true

Windows10搭建Flutter桌面应用环境

执行:flutter config --enable-windows-desktop 

执行:flutter devices查看当前连接设备

Windows10搭建Flutter桌面应用环境

下载flutter-desktop-embedding

flutter SDK放在同一级目录:

执行git clone https://github.com/google/flutter-desktop-embedding.git

cd ./flutter-desktop-embedding

VS Code打开./flutter-desktop-embedding/testbed文件夹

Ctrl+~打开终端执行flutter doctor提示缺少Visual Studio工具链

安装VS 2019企业版vs_community__1874668239.1578475388.exe

工作负载中Windows下的全选,右边组件Win10 SDK也全选,确保不会遗漏环境。

Windows10搭建Flutter桌面应用环境

 

成功安装VS2019后,再次执行flutter doctor

Windows10搭建Flutter桌面应用环境

Windows10搭建Flutter桌面应用环境

环境依赖应该没问题了~

执行flutter pub get

Windows10搭建Flutter桌面应用环境

最后执行运行:flutter run

Windows10搭建Flutter桌面应用环境

应用窗口被打开:

Windows10搭建Flutter桌面应用环境

Windows10搭建Flutter桌面应用环境

上一篇:Spark学习摘记 —— Pair RDD行动操作API归纳


下一篇:asp.net core 3.1 webapi接口参数有时间类型取不到值得问题