首页 > 解决方案 > Flutter web:连接服务器进行调试

问题描述

我想通过http-server启动我的flutter web项目,并连接vs代码来调试它。

  1. 我创建了一个颤振项目;
  2. 我用下一个命令构建了它flutter build web --profile
  3. 我已经使用 http-server 启动了应用程序

在此处输入图像描述

但我不知道如何在 vs 代码中连接到服务器 :(。

debugServer在 launch.json 文件中找到了参数,但在文档中找不到此参数,但此参数有说明:

For debug extension development only: if a port is specified VS Code tries to connect to a debug adapter running in server mode

也许,我应该安装任何调试适配器还是这个参数不起作用或不可能?

{
    // 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": "connect to the server",
            "request": "launch",
            "type": "dart",
            "debugServer": 3333
        },
    ]
}

标签: flutterdartflutter-web

解决方案


推荐阅读