SyncroIT
SyncroIT

Reputation: 1578

Wrap autocompleted arguments on a new line in Flutter in VS Code

Is there a way, in VS Code, to make the autocompleted widget arguments go on a new line?

Bad:

Column(children: [])

Good:

Column(
    children: []
)

I guess it has something to do with the dart_style's formatter (?)

Upvotes: 1

Views: 68

Answers (1)

julemand101
julemand101

Reputation: 31299

You can add a comma after the last argument to tell the Dart formatter that you want the argument to be split across multiple lines:

Column(
  children: [],
);

(This is something that might change in the future: https://github.com/dart-lang/dart_style/issues/1253)

Upvotes: 2

Related Questions