Usefull VSCode configurations to save time

Flutter tips Published on

VSCode offers many ways to make coding faster and easier. You can set it up to do things like automatically format your code when you save a file. Here are some helpful settings that can really save you time when working, especially with Flutter.

Why These Settings Help

Coding involves lots of small tasks, like making sure your code looks neat (formatting) or fixing simple errors. Doing these manually takes time. By automating them, you can focus more on building cool features.

Key VSCode Settings

These settings go into your VSCode settings.json file. You can open it by pressing Ctrl+, (or Cmd+, on Mac) and searching for "settings json".

General Formatting

"editor.formatOnSave": true

This setting means VSCode will try to format your file every time you save it. This keeps your code looking consistent automatically.

Dart Specific Settings

Sometimes, you want slightly different behavior for specific languages like Dart. You can set language-specific rules inside the [dart] section.

Dart Formatting on Save

"editor.formatOnSave": false

Inside the [dart] block, setting formatOnSave to false overrides the global setting for Dart files. This might be used if you prefer formatting Dart using other methods or specific save actions.

Turning Off Inlay Hints

"editor.inlayHints.enabled": "off"

Inlay hints show extra information right in your code, like variable types in grey text. Turning them "off" makes the code view less cluttered, which some developers prefer.

Save Actions for Dart

"editor.codeActionsOnSave": {
  "source.fixAll": "explicit",
  "source.organizeImports": "explicit"
}

This tells VSCode to run specific actions when you save a Dart file. The "explicit" value means these actions run when you explicitly save the file (like pressing Ctrl+S/Cmd+S).

Fix All Issues

"source.fixAll": "explicit" This action automatically applies suggested fixes for various issues in your code when you save. This can include adding missing const keywords or fixing other small warnings.

Organize Imports

"source.organizeImports": "explicit" This action automatically sorts your import statements and removes any imports that aren't being used in your file when you save.

By setting up these configurations, you can let VSCode handle repetitive tasks, giving you more time to code!

Save 3 months of work

Create your app using our 6 years of making Flutter apps and more than 50+ apps

kickstarter for flutter apps

Frequently Asked Questions

What is VSCode?

VSCode (Visual Studio Code) is a popular, free code editor used by developers for many programming languages, including Dart and Flutter.

How do I add these settings to VSCode?

You can add these settings to your VSCode `settings.json` file. Open the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`), type Open Settings (JSON)

What does `editor.formatOnSave` do?

This setting tells VSCode to automatically format your code based on your formatter rules every time you save a file.

What is `editor.codeActionsOnSave` used for?

This setting allows you to configure specific actions, like fixing code issues or organizing imports, to run automatically whenever you save a file.

What are inlay hints?

Inlay hints are small pieces of text, often shown in grey, that VSCode adds directly into your code view to provide extra context, like variable types or parameter names.

Read more
You may also be interested in
Single execution Future Builder  blog card image
Single execution Future Builder
Published on 2025-06-18T12:02:11.525Z
What are render objects  blog card image
What are render objects
Published on 2025-06-18T12:07:12.212Z
ApparenceKit is a flutter template generator tool by Apparence.io © 2025.
All rights reserved