I just got started with dart and I have managed to configure correctly dart command line projects and a flutter app within vs code, and debugging works as expected, to attempt a cross platform project However with dart angular, i cant get breakpoints to work, the docs in the dart seem to focus mostly in flutter however i cant breakpoint within just this specific type of dart project. This is my current dart launch.json.
{
"version": "0.2.0",
"configurations": [
{
"name": "Dart",
"program": "web/main.dart",
"request": "launch",
"type": "dart"
}
]
}
I am using dart version 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 thedebugger function at the top of your main
function if you need to break in startup code).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.