Mac 下 VSCode 搭建dart调试环境
2021-03-31 本文已影响0人
lsj980Ya
1,安装VSCode
2,安装Dart和Code Runner

3,建议先创建一个文件夹存放dart文件,然后在VSCode中打开文件夹,这样方便使用统一配置,最后如下:

4 VSCode打开文件夹,然后f5开启调试,选择dart&flutter,此时不出意外会报错并生成一个隐藏的 .vscode/launch.json 文件,然后设置 "program": "demo.dart"
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Dart & Flutter",
"request": "launch",
"type": "dart",
"program": "demo.dart"
}
]
}
再次按f5即可调试
