I find it incredibly distracting to code with 2 spaces indentation, so I always set my indentation size to 4 spaces, however, on this flutter project, the indentation stays at 2 spaces, no matter what I change, it refuses to be 4 spaces... (this applies to all files, not just the main.dart file)
I've tried setting indentation spaces to 4 from 2 (https://mcmap.net/q/109299/-visual-studio-code-format-is-not-using-indent-settings and https://mcmap.net/q/235159/-how-do-i-change-vscode-to-indent-4-spaces-instead-of-default-2) but even when it is set to 4 spaces for Dart specific projects (the json file), workspace settings (assuming frontend for json file) and in the VSCode user settings tab, it goes back to 2 spaces on format (or rather the settings stays at 4 spaces, but it still formats at 2 spaces). I do not have a .editorconfig
, so I couldn't change it there. I've also disabled detect indentations (https://mcmap.net/q/109299/-visual-studio-code-format-is-not-using-indent-settings) on all the levels I did with the indentations sizes.
Could it be that dart_style (which I am assuming is formatting the code), enforces 2 spaces indentations? If it is, is it possible to change it?
Although, taking a look through its code, it shouldn't be enforcing 2 spaces, like this function. (see image)
I also only have these 2 extensions for Dart/Flutter, and only Prettier formatter (only other formatter), but disabling it does not fix the issue...