9.9 C
New York
Wednesday, March 22, 2023

Prevent VS Code from Auto Formatting Flutter/Dart Code

By default, VS Code (Visual Studio Code) will automatically format your code when you save a Dart file. In general, this feature is useful and makes your code cleaner, and has a consistent arrangement. However, there might be cases where this thing doesnÂ’t fit your need. In these situations, you can turn off that format-on-save feature. The steps below will show you how to achieve your goal.

1. Click on “Dart” which locates in the bottom bar of your VS Code window (you need to open a Dart file to see it).Advertisements

2. Select “Configure ‘Dart’ language based settings…” from the drop-down.Advertisements

3. In the settings.json file, change “editor.formatOnSave” from “true” to “false”.

Save the file and everything is now done.

Further reading:

You can also take a tour around our Flutter topic page and Dart topic page to see the latest tutorials and examples.Advertisements

Advertisements

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles