Valentin Vignal
Valentin Vignal

Reputation: 8268

Where do I get the config for dart launch in VSCode?

I'm working on a flutter web project with VSCode and I noticed some inconsistency between the app when it is rendered by the VSCode debugger or through the command line. The app (color, alignment, font ...) doesn't look the same in both scenarios.

For example, here is what is rendered when I launch the debug in VSCode:

enter image description here

here is the configuration in the launch.json

{
    "name": "Launch",
    "request": "launch",
    "type": "dart",
    "program": "lib/main.dart"
},

And here is what is rendered when I run the command

flutter run lib/main.dart

enter image description here


I managed to "fix" the command line display by adding the flag --web-renderer canvaskit to the command line.


Now, what I would like to know is what are the settings used by the VSCode debugger, and where to find them /modify them?

Upvotes: 0

Views: 2350

Answers (2)

bara batta
bara batta

Reputation: 1234

Just add this line:

"toolArgs":[ "--web-renderer canvaskit"]

It will become:

{
"name": "Launch",
"request": "launch",
"type": "dart",
"program": "lib/main.dart",
"toolArgs":[ "--web-renderer canvaskit"]

},

Upvotes: 0

harsha20599
harsha20599

Reputation: 139

Selection menu for vscode

Go to "open configurations" from Run menu

There, in the launch.json file, you can add your args in this format

enter image description here

Upvotes: 2

Related Questions