当前位置: 首页 > news >正文

win11+vscode+Flutter 开发环境配置

https://blog.csdn.net/Oven_maizi/article/details/126804404

1 vscode插件 安装

安装红框中的两个

2 flutter sdk 安装

dart sdk 包含在flutter sdk 里面,路径:flutter_windows_3.24.1-stable\flutter\bin\cache\dart-sdk

方式1:

通过vscode安装Flutter插件后,ctrl+shift+p 输入flutter,vscode的右下角会提示安装Flutter sdk

方式2:

​​​​​​​版本列表 | Flutter 中文文档 - Flutter 中文开发者网站 - Flutter

方式3:

下载源码到一个目录,添加它的bin目录路径到 环境变量 中

git clone https://github.com/flutter/flutter.git

3 新建一个 flutter 项目

新建Flutter项目后,可以在lib目录通过终端去执行演示程序

4 演示程序执行前 flutter doctor 检查

首次运行 flutter doctor 报的错误,可以看到报错提示,安卓开发、win开发 还缺少依赖,但

web开发是可以的,那么只需要解决 网络资源不可用问题

PS E:\workspace\test_drive\flutter_application_1\lib> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [版本 10.0.22631.4037], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[X] Android toolchain - develop for Android devicesX Unable to locate Android SDK.Install Android Studio from: https://developer.android.com/studio/index.htmlOn first launch it will assist you in installing the Android SDK components.(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).If the Android SDK has been installed to a custom location, please use`flutter config --android-sdk` to update to that location.[√] Chrome - develop for the web
[X] Visual Studio - develop Windows appsX Visual Studio not installed; this is necessary to develop Windows apps.Download at https://visualstudio.microsoft.com/downloads/.Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] Connected device (3 available)
[!] Network resourcesX A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到! Doctor found issues in 4 categories.

临时解决办法:

在中国网络环境下使用 Flutter | Flutter 中文文档 - Flutter 中文开发者网站 - Flutter

根据上述文档,在powerShell执行下述命令

 $env:PUB_HOSTED_URL="https://pub.flutter-io.cn"$env:FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"

再次运行  flutter dockor,网络错误已经解决。

PS E:\workspace\test_drive\flutter_application_1\linux> flutter doctor
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [版本 10.0.22631.4037], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[X] Android toolchain - develop for Android devicesX Unable to locate Android SDK.Install Android Studio from: https://developer.android.com/studio/index.htmlOn first launch it will assist you in installing the Android SDK components.(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).If the Android SDK has been installed to a custom location, please use`flutter config --android-sdk` to update to that location.[√] Chrome - develop for the web
[X] Visual Studio - develop Windows appsX Visual Studio not installed; this is necessary to develop Windows apps.Download at https://visualstudio.microsoft.com/downloads/.Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] Connected device (3 available)
[√] Network resources! Doctor found issues in 3 categories.

最终解决办法:

后面又发现上述命令只是临时修改当前终端的环境变量,还需在 Windows 中永久设置环境变量

验证环境变量是否生效

新启动一个powershell,执行下述代码,回显不为空才对

echo $env:PUB_HOSTED_URL

4 web开发

下载一个谷歌

5 android开发 额外配置

1 下载 android studio 

https://developer.android.com/studio/install?hl=zh-cn#windows

2 android studio 安装包,引导式安装 一路都是默认,目标是安装好下面组件

3 打开android studio,额外安装命令行工具

4. 新建android 虚拟机

5.演示程序运行在安卓平台前检查

5.使用vscode启动安卓虚拟机

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • Python OpenCV 入门指南
  • 八月二十九日(day 39)docker6
  • 个人笔记总结
  • ClickHousez中如何定时清理过期数据库?
  • Akka-集群
  • H264编码
  • 深度学习速通系列:贝叶思和SVM
  • 通过自定义注解、反射和AOP在Spring Boot中动态修改请求参数
  • Android运行时权限详解
  • 低通滤波器
  • Hive/Spark小文件解决方案(企业级实战)–参数和SQL优化
  • Redis在Spring Boot中的应用详细讲解和案例示范
  • C语言实现经典排序算法
  • Go语言的前世今生与未来展望
  • 解析 Agent 在国外智慧金融领域的一个落地场景:智能顾投
  • 《Java编程思想》读书笔记-对象导论
  • 【翻译】Mashape是如何管理15000个API和微服务的(三)
  • 【腾讯Bugly干货分享】从0到1打造直播 App
  • Android路由框架AnnoRouter:使用Java接口来定义路由跳转
  • Docker下部署自己的LNMP工作环境
  • Git学习与使用心得(1)—— 初始化
  • Java读取Properties文件的六种方法
  • Java面向对象及其三大特征
  • mac修复ab及siege安装
  • PHP那些事儿
  • supervisor 永不挂掉的进程 安装以及使用
  • 闭包--闭包作用之保存(一)
  • 个人博客开发系列:评论功能之GitHub账号OAuth授权
  • 精益 React 学习指南 (Lean React)- 1.5 React 与 DOM
  • 如何胜任知名企业的商业数据分析师?
  • 新书推荐|Windows黑客编程技术详解
  • 云大使推广中的常见热门问题
  • 找一份好的前端工作,起点很重要
  • # Java NIO(一)FileChannel
  • #免费 苹果M系芯片Macbook电脑MacOS使用Bash脚本写入(读写)NTFS硬盘教程
  • ( 用例图)定义了系统的功能需求,它是从系统的外部看系统功能,并不描述系统内部对功能的具体实现
  • (补充):java各种进制、原码、反码、补码和文本、图像、音频在计算机中的存储方式
  • (二)什么是Vite——Vite 和 Webpack 区别(冷启动)
  • (十三)Flask之特殊装饰器详解
  • (顺序)容器的好伴侣 --- 容器适配器
  • (转)程序员疫苗:代码注入
  • (转载)VS2010/MFC编程入门之三十四(菜单:VS2010菜单资源详解)
  • (转载)微软数据挖掘算法:Microsoft 时序算法(5)
  • **登录+JWT+异常处理+拦截器+ThreadLocal-开发思想与代码实现**
  • .NET 8 中引入新的 IHostedLifecycleService 接口 实现定时任务
  • .NET Core中如何集成RabbitMQ
  • .net 受管制代码
  • .net的socket示例
  • /etc/fstab和/etc/mtab的区别
  • /proc/interrupts 和 /proc/stat 查看中断的情况
  • @AutoConfigurationPackage的使用
  • [17]JAVAEE-HTTP协议
  • [2669]2-2 Time类的定义
  • [Angular 基础] - 表单:响应式表单
  • [BUAA软工]第一次博客作业---阅读《构建之法》