Disable autoformat in VS Code for dart
config file .vscode/settings.json
{ "editor.formatOnSave": false, "[dart]": { "editor.formatOnSave": false }}
I am having the same problem that you have. I couldn't find a way to fix it but there is a way to save the code without formatting. On Windows, if you click Ctrl + K
then Ctrl + Shift + S
, it will save the file without formatting. I am not sure on Mac but if you go to command palette and search save without format
, it will show you the shortcut to do it. Hope this helps!