0

0

VSCode for Dart and Flutter: A Complete Guide

P粉986688829

P粉986688829

发布时间:2025-12-22 14:52:02

|

599人浏览过

|

来源于php中文网

原创

需安装Dart与Flutter扩展、配置SDK路径、启用DevTools集成、设置launch.json调试配置,并通过新建Flutter项目验证环境。

vscode for dart and flutter: a complete guide

If you are setting up Visual Studio Code for Dart and Flutter development, the process involves installing specific extensions, configuring SDK paths, and enabling essential tooling. Below are the steps to establish a fully functional Dart and Flutter coding environment in VSCode:

本文运行环境:MacBook Air,macOS Sequoia

一、Install the Dart and Flutter extensions

This step adds language support, syntax highlighting, code completion, and debugging capabilities for Dart and Flutter projects within VSCode.

1、Open VSCode and click on the Extensions icon in the left sidebar or press Cmd+Shift+X.

2、In the search bar, type Dart Code and install the extension published by Dart-Code.

3、Repeat the search with Flutter and install the official Flutter extension.

二、Configure the Dart and Flutter SDK paths

VSCode needs to locate the installed Dart and Flutter SDKs to provide accurate analysis, autocomplete, and command execution. Manual path configuration is required if auto-detection fails.

1、Open VSCode Settings using Cmd+,.

2、Search for dart.sdkPath and enter the full path to your dart-sdk/bin directory.

3、Search for flutter.sdkPath and enter the full path to your flutter directory root.

三、Enable Dart DevTools integration

Integrating DevTools allows direct access to performance profiling, widget inspection, and debugging tools from within VSCode without switching contexts.

1、Ensure the Dart Code extension is installed and reloaded.

PNG Maker
PNG Maker

利用 PNG Maker AI 将文本转换为 PNG 图像。

下载

2、Open a Flutter project folder in VSCode.

3、Press Cmd+Shift+P, type Dart: Open DevTools, and select it to launch the browser-based DevTools interface.

四、Set up launch.json for debugging

A custom launch configuration enables breakpoints, variable inspection, and hot reload control during Flutter app execution directly from VSCode.

1、Open the project’s lib/ folder in VSCode.

2、Go to the Run view via Cmd+Shift+D, then click create a launch.json file.

3、Select Flutter as the environment and confirm to generate the default configuration.

五、Verify setup with a new Flutter project

Creating and running a minimal Flutter project confirms that all components—SDK, extensions, and tooling—are correctly linked and operational.

1、Open the integrated terminal in VSCode using Ctrl+`.

2、Run flutter create my_app to generate a new project.

3、Navigate into the project with cd my_app, then run code . to reopen the folder in VSCode.

4、Press F5 or click the green play button in the Run view to start debugging on an attached device or emulator.

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
json数据格式
json数据格式

JSON是一种轻量级的数据交换格式。本专题为大家带来json数据格式相关文章,帮助大家解决问题。

418

2023.08.07

json是什么
json是什么

JSON是一种轻量级的数据交换格式,具有简洁、易读、跨平台和语言的特点,JSON数据是通过键值对的方式进行组织,其中键是字符串,值可以是字符串、数值、布尔值、数组、对象或者null,在Web开发、数据交换和配置文件等方面得到广泛应用。本专题为大家提供json相关的文章、下载、课程内容,供大家免费下载体验。

535

2023.08.23

jquery怎么操作json
jquery怎么操作json

操作的方法有:1、“$.parseJSON(jsonString)”2、“$.getJSON(url, data, success)”;3、“$.each(obj, callback)”;4、“$.ajax()”。更多jquery怎么操作json的详细内容,可以访问本专题下面的文章。

311

2023.10.13

go语言处理json数据方法
go语言处理json数据方法

本专题整合了go语言中处理json数据方法,阅读专题下面的文章了解更多详细内容。

77

2025.09.10

if什么意思
if什么意思

if的意思是“如果”的条件。它是一个用于引导条件语句的关键词,用于根据特定条件的真假情况来执行不同的代码块。本专题提供if什么意思的相关文章,供大家免费阅读。

776

2023.08.22

go中interface用法
go中interface用法

本专题整合了go语言中int相关内容,阅读专题下面的文章了解更多详细内容。

76

2025.09.10

default gateway怎么配置
default gateway怎么配置

配置default gateway的步骤:1、了解网络环境;2、获取路由器IP地址;3、登录路由器管理界面;4、找到并配置WAN口设置;5、配置默认网关;6、保存设置并退出;7、检查网络连接是否正常。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

223

2023.12.07

vscode
vscode

VS Code(Visual Studio Code)是一款免费、开源的跨平台代码编辑器,由微软开发和维护。它被广泛用于软件开发和编程,支持多种编程语言和框架。VS Code 同时提供了丰富的功能和扩展性,使开发者可以高效地编写、编辑和调试代码。

592

2023.06.30

俄罗斯Yandex引擎入口
俄罗斯Yandex引擎入口

2026年俄罗斯Yandex搜索引擎最新入口汇总,涵盖免登录、多语言支持、无广告视频播放及本地化服务等核心功能。阅读专题下面的文章了解更多详细内容。

84

2026.01.28

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
go语言零基础开发内容管理系统
go语言零基础开发内容管理系统

共34课时 | 2.6万人学习

第二十三期_前端开发
第二十三期_前端开发

共98课时 | 7.5万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号