1,安装VSCode
2,安装Dart和Code Runner
![](https://img.haomeiwen.com/i6101840/ef0aed39272ef78d.png)
3,建议先创建一个文件夹存放dart文件,然后在VSCode中打开文件夹,这样方便使用统一配置,最后如下:
![](https://img.haomeiwen.com/i6101840/99d0d0ded30a0ffe.png)
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即可调试
![](https://img.haomeiwen.com/i6101840/ba3f67c5fc8476eb.png)
网友评论