Reputation: 706
Auto-Indent Lines improperly shifts indent of Redirecting constructors.
The result of Auto-Indent is below.
Project.getInbox()
: this.update(
foo: 1,
bar: 2,
baz: 3);
The result I want is below.
Project.getInbox()
: this.update(
foo: 1,
bar: 2,
baz: 3);
Best regards,
Upvotes: 3
Views: 6851
Reputation: 61
If you are an Android Developer and cannot leave Android Studio, since it's your coding home, but can't let go of flutter either.
Use a different theme: Visual Studio 2019 Dark Theme (this auto adjusts indentation and makes code look exactly as of Visual Studio Code). To install theme - plugins -> search "Visual Studio 2019 Dark Theme"
OR
Use a different font: I prefer
Font : "Droid Sans Mono Slashed" or "Monospaced" (You can use any that works for spacing)
Font size: 18 , Line Height 1.4 // For 14 inch screens
Font size: 14 , Line Height 1.2 // For 15.6 inch screens or larger
OR
A combination of above looks beautiful.
Upvotes: 0
Reputation: 51682
Dart (and therefore Flutter) uses its own code formatter dartfmt, so it's not possible to control indentation etc through the IDE. In this case, dartfmt will format the code differently depending on the optional trailing comma.
Without
Project.getInbox() : this.update(foo: 1, bar: 2, baz: 3);
With
Project.getInbox()
: this.update(
foo: 1,
bar: 2,
baz: 3,
);
Upvotes: 10