skip to Main Content

is there a way to customize the dart/flutter formatter for VSCode?

The new way of formatting is terribly unreadable!

Terrible

How am i supposed to find brackets if they don’t respect the indentation level?

I would like to have something like this:

Ordered

As you can see here you can follow the column to find where the closure ends.

I wonder if there is a way to customize the dart formatting.

Thank you in advance.

2

Answers


  1. Add comma , between ) whenever possible. If you are having problem with max line change the setting from

    enter image description here

    Login or Signup to reply.
  2. This is probably caused by a low value on the Dart: Line Length setting.

    To fix this, try in Visual Studio Code going on:

    • File > Preferences > Settings (or CTRL + ,).
    • Search for "Dart Line Length" and edit the value (mine is set to 80, higher means more space horizontally).
    • Save a .dart file and it should automatically re-indent/format your code.

    screenshot

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search