dart - 飞镖角度与调试
问题描述
我刚开始使用 dart,我已经成功地在 vs 代码中正确配置了 dart 命令行项目和颤振应用程序,并且调试按预期工作,以尝试跨平台项目但是使用 dart angular,我无法让断点工作, dart 中的文档似乎主要集中在颤振中,但是我不能在这种特定类型的 dart 项目中设置断点。这是我当前的 dart launch.json。
{
"version": "0.2.0",
"configurations": [
{
"name": "Dart",
"program": "web/main.dart",
"request": "launch",
"type": "dart"
}
]
}
我正在使用飞镖版本 2.9.1。
解决方案
however i cant breakpoint within just this specific type of dart project
Right now there is a race condition in non-Flutter web debugging, where the breakpoints are not set up before the app starts, so any breakpoints in startup code are missed.
There's an open issue at https://github.com/dart-lang/webdev/issues/830 but as a workaround you could try inserting a delay (eg. await Future.delayed(const Duration(seconds: 1))
or calling the debugger function at the top of your main
function if you need to break in startup code).
推荐阅读
- php - PHP - 加载 XML/修改/保存的函数
- dialogflow-es - 如何使用 facebook 循环在 Dialogflow 中制作自定义有效负载,返回到先前的意图?
- mysql - 如何访问在 docker 容器(由 Rancher 管理)中运行的 MySQL,而不在主机上发布端口?
- php - 如何设置,该参数值在 nelmio api doc 中可以为空?
- python - 带有附加列表的 for 循环
- cloud-foundry - 容器权限
- kivy - 在 Python Kivy 中更改屏幕后如何关闭 ModalView
- connection - 如何在 H2 中可视化 Microsoft Power BI?
- angular-material - MatTooltip 在整个项目中不会与其对象/按钮对齐,我该如何对齐它?
- svg - svg sprites 和 svg4everybody