VsCode is not stopping on breakpoints - Flutter

Viewed 828

Brand new to flutter and I'm using VSCode as my IDE. However, I can't seem to get VSCode to call any of my breakpoints I place. I've tried normal breakpoints, Expression Breakpoints. None of them are even registering.

Everywhere online says to change the launch.json which I have done as show below

"version": "0.2.0",
    "configurations": [
        {
            "name": "Flutter",
            "request": "launch",
            "type": "dart",
            "flutterMode": "debug"
        },
    ]

However it didn't do anything. I'm using android studio's emulator and sometimes chrome; works on neither. Any help is appreciated :)

2 Answers

Well, you can use the developer package to make breakpoints

import 'dart:developer';

void someFunction(double offset) {
  debugger(when: offset > 30.0);
  // ...
}

Look it in documentation

I solved this issue by disabling Dart: Preview Sdk Daps in Settings. My Dart SDK was not linked to the remote repository and was outdated so this setting was not working properly. This is done with "dart.previewSdkDaps": false

{
    "workbench.startupEditor": "none",
    "editor.minimap.enabled": false,
    "debug.toolBarLocation": "docked",
    "files.autoSave": "onFocusChange",
    "dart.previewSdkDaps": false
}
Related