The VSCode Shortcuts, Extensions & Settings for Flutter Development
Tags: flutter
Published: 2023-04-12 21:59:54

---
title: The VSCode Shortcuts, Extensions & Settings for Flutter Development
published: true
date: 2023-01-28 14:09:00 UTC
tags: Flutter
canonical_url: https://tutorialboy24.blogspot.com/2023/01/the-vscode-shortcuts-extensions.html
---

 ![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9MMDduiQBuY46YHE8ZYCb5DMUEXN6CjJRuOss9THOwmQ4vOLEKQ5UQ6n67DGpp8mNCJVFITjV0g7D0NGu3Wh0vT972c_7-YTWQD5ItjVTyTif1kZDSu3pjDa-JPZ6g5k-SE6xQrIapfWjHCZsW-f8Ww-cYMG0TmpnrITOhMeUCJxuvGbPffvNven3ug/w640-h360/My%20project-1.png)

VSCode is an excellent IDE for Flutter development.

After you have completed [the basic setup steps](https://flutter.dev/docs/development/tools/vs-code), the best thing you can do is to customize it to boost your workflow.

So in this article, I'll show you all the shortcuts, extensions, and settings that I use for day-to-day Flutter development.

# VSCode Shortcuts for Flutter Development

YouTube already has many excellent videos about VSCode shortcuts, and I'll link the best ones at the end.

But for now, here's a short list of my favorites:

## Quick Fix

- MacOS: CMD+.

- Windows: CTRL+.

Use this anywhere in the editor to get a contextual list of code actions.

You can use it to wrap, extract, remove widgets, etc:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEitivsWkv-zZ-67_UdZQ5-aYHi2La1qapNN-3tyWcABPNwMePmig1FFTFnuF0dEE38TRkWG32iSRMy0owoW0PsNR-l4mHqefx5_0i1oT_65rIHabAMX9l3bB2iUcNpWOC0SqWDi-4xnNxJQDZy8YeW6BsZz47FnfBiHsk0Ya8i1qdjXX0tIRgauEb791w=w640-h242)

Or to import files when needed:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEiN9Y347sonCE1VuC_FTxFWJPDvMzi_kQGfcTl6CsOjGcWFOfmwxicO0J4SlGgVboLvVAxBf1maE4A2FbfTomrUmKBkqRTDMiUaBHFwxN-3gYPAjapocnR4eM4shSrySBnc82PljGPXUQbV3O3fQcH6Vb1XqaS6P08lEnjWGV1VEEwLGZM_yyhaGTX9gw=w640-h182)

Or create a constructor (or all the data class methods) from existing properties in a class.

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjNoMT9TD6qsrNMEt_FdNj6i1htBhdhhqmHupT167qRodKMkC3vdAAf1d4KS6LKu1tfP5v2Cl5KhqCYffbhen083ndFTlNdx4q7ssezq12Z_q7v2SfmNSegtfrGwbjzFOJH0EIB7b7PxfEWp7OiLk5dHzFEcnYY_cg-t_-KsCJHzk8ny7VqycjsM0sYCg=w640-h166)
  

## Show Command Palette

- MacOS: CMD+Shift+P

- Windows: CTRL+Shift+P

This will bring up a search box where you can see all the recently used commands and type to search new ones:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEgy5KQ8QAs6086yoGOwfRP4JWdrSdvOE-MO_CCpPFmp57cN-TkExQpPFOXQaULRZf9hXMfnucou4jviWqcPAxF5_7PVU2lb7aGhka_NYbqP5bNSLQp5xEPkTmTdnh4xP8466yZIWIXkuPUaBhtn6bwTd0WFsPdhME7dqhGLQxT63XvwKlCSW0Snm4hcWg=w640-h324)

## Search files by name

- MacOS: CMD+P

- Windows: CTRL+P

This is great for opening any file in your project without leaving the keyboard:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEiWXnaYBffh4yCjlz3bf6w6t5bMmP5d-ldo_IZtGCkhebVMrpfs_W1ppXhMUJMSNLoGJb8_nFGkYrGoIXcy-GclYUCM6PbFyKQjJUwMY1I3sEoarZe0vIE6Y5Rr1716Qq4Yj403dmmUXj8JRkXd19VAuStsSekz-gMGlJf6eszqRmX_MgfplRbl5uiKig=w640-h180)

## Dart: Add Dependencies

First, open the command palette and type "Dart: Add Dependency" or "Dart: Add Dev Dependency":

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEif1VN5iG1LBvz0dZ7vXsy9J_WgsUY43OUoR_5F1ZKCzRziovuxpZLteBJQTJpCE3uDOYTXhTWsOcoxRYpDROS1Um2HaYozjNHeEEEnP6j15l9bT-xKdOB56BrUPA2PS9gJ7W7oL83FXwrtnlah0QvtTyroN_s8A1Igvuz8yGHCcnvV8DP0PJyux-03IA=w640-h184)

It will then show a searchable list of packages that are available on pub.dev:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjHh6I7wikMz_Rtd5Mki5xfcAPWwkSISjYy-F-xn_ZsVgQN8m68oe5iwmZGah-7-az6K3OWEotjrtSNNcbAKy0j332ykIMSYV7SDzLF9L6Sh9EXEHUDpdzAugbdCJWt1ShmCYZQI6jeZzOOLUeXU6sCVL20HPT6ABJyKh9MSOPQ8gbqfQk8tr9XEvsoqg=w640-h238)

Once you select a dependency, it will be added to your pubspec.yaml file and installed automatically.

## Flutter & Dart snippets

The Dart and Flutter plugins include many snippets that you can use to add standard Flutter widgets quickly.

You may already be familiar with these:

- stless: Insert a StatelessWidget

- stful: Insert a StatefulWidget

- stanim: Insert a StatefulWidget with an AnimationController

[![](https://blogger.googleusercontent.com/img/a/AVvXsEh8-IB-y9vtjfKk9rq5jFeFSqFIMp8BbrISwKXmdpUz6MYUkyj7mQ0pl8X0oQJy7NCJoLPUW9VCgv8d6o4ScO5BSi-Y0BiOp8ObxAyi4TSiSunT_rDL2ePTrufA-n8AjvQZZbOLX8qDAR0it27yUAEDOs2LiCZycjLAD03Oc2XMaIvXZjr7j4ObAkrJYQ=w640-h108)](https://blogger.googleusercontent.com/img/a/AVvXsEh8-IB-y9vtjfKk9rq5jFeFSqFIMp8BbrISwKXmdpUz6MYUkyj7mQ0pl8X0oQJy7NCJoLPUW9VCgv8d6o4ScO5BSi-Y0BiOp8ObxAyi4TSiSunT_rDL2ePTrufA-n8AjvQZZbOLX8qDAR0it27yUAEDOs2LiCZycjLAD03Oc2XMaIvXZjr7j4ObAkrJYQ)
  
These are great because they generate all the boilerplate code for you, and all you have left to do is to name your widget:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEh8IPTucQNWf_F_M4L341eypJUJNcSLXmZ3QoUpojrjTMZUeZ7MXLPeDyuyp-JflbNTQCEuXRB68Nw3N8rkMP5EwTdDRXdTO3_fEz82_S-rqH2ZlO4s_N4FYyZlGOm9mHGrKs4syuTlFDQjryOUyRv1dJisJzgwUVPV8Ab-HCCnkVaer6RMfi4GjIKy4A=w640-h470)

But you can also use snippets to generate common code blocks, such as if/else, for loops, function definitions, etc:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEig-8SeDMogFe5mseBrjqdFj7S88CR_N6drUYGoY1OWgnRmeVh_TDBX4w-D7fkLHG5EoE9U8F6h2LHVd5qE8m4guGvkcmi7YNNVb1gs2mOqS-4FLrTfZLh8pMwPk1Y1HuVTKSb9TMbzO7OB1pbR9VPYwn66VGpICceDT3G_cU-_D9GpXgcIGfUF5t8izA=w640-h128)

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhTFH6Tj0hAAv291IwvREhaKsyotTSVGi8uwY_C7wsDkZaaTFuuKTow0srsLATY7SzIYESAWVeFTJmit05whzVdyrqfQtNB5FcHS3unwtxjWEDkWQaWCQ5iMy-YILg-i6PkaGnu8M7FNFGOaM81_E7pweGBvsKGj5qxrZ1WxNYLgNMeAAeuElnxlZmxtg=w640-h118)

To see all the available Dart snippets, check this file.

If you want to take this further, you can install the [Awesome Flutter Snippets](https://marketplace.visualstudio.com/items?itemName=Nash.awesome-flutter-snippets) extension, which offers many other useful snippets.

## Keyboard Shortcuts list

- MacOS: CMD+K CMD+S

- Windows: CTRL+K CTRL+S

VSCode has a ton of shortcuts. If you want to see them all and customize the key bindings, this is the one to use:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEh-QsfZM64jmWifjzYzADhJ8jQEt151eTTDXBB4IQZm2Ivjj4b4ufahl6qIKPzba5zDT1Hw5dXiJGWrLSW-PURnixg_Iayg5Hi4afk53i_rQXIOTNVgsHi40MgZYD5QYrn3Tp3Ttz5b46gpMTLjTk2gmVQJdyRWCP3JSe-gNf1v6j6EYeZ-ADJkyj9RQw=w632-h640)

# VSCode Extensions for Flutter Development

Using the right extensions will save you a lot of time and give you superpowers. These are my favorites:

## Dart Data Class Generator

When creating model classes, you'll often need methods such as copyWith(), toString(), toJson(), fromJson(), toMap(), fromMap(), ==, hashCode.

This is tedious and error-prone.

Instead, it's much better to use the [Dart Data Class Generator](https://marketplace.visualstudio.com/items?itemName=hzgood.dart-data-class-generator)to do the work for you:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjxF77TyV_MSO_U0mjaVUrg5jUp1Axn66vb0kBhTaAO_HtCxmCwCZvU-elrws-9-crgD6QGeaVontRMDlLR7jNBoD1kVUDUQGbUQRHcq4iLAVeDStSEa2s4SBkcEk1L_tpW87W9Q7AthlHEhaGK5T4BU5kZ4T6ywWITLXn6cIurx_xCEN0sIwKbzDOwAA=w640-h330)
  

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEiqIHDXno0tmAKOaIQO7v-5rTTEOAGcaztpq--UOQe9H6LKBeNv_1Ds6FS81ZZNhjKjY9DJaDBY2RtJCTVT4bk60yMyrkrDW_JksrRLe146536xTsi4cgZHz6RCY28WAjlahacHByorhmQqgimNiSPM1E6bjtfE4hvg0WLutCbx-QqYSsW83Sd9pydQxQ=w523-h640)
  

Especially if you have model classes with many properties, this can be a huge time-saver!

**Download here:**

- [Dart Data Class Generator](https://marketplace.visualstudio.com/items?itemName=hzgood.dart-data-class-generator)

Note: there's also an alternative called Json to Dart Model which is quite configurable and can also leverage code generation libraries like [Freezed](https://pub.dev/packages/freezed) and [Json Serializable](https://pub.dev/packages/json_serializable):

- [Json to Dart Model](https://marketplace.visualstudio.com/items?itemName=hirantha.json-to-dart)

## Flutter Riverpod Snippets

If you use Riverpod, you'll quickly get tired of typing all your providers and consumers by hand.

By using the [Flutter Riverpod Snippets](https://marketplace.visualstudio.com/items?itemName=robert-brunhage.flutter-riverpod-snippets) extension by Robert Brunhage, this job becomes much easier:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjjWt3WORlL7_DQqzTLE7SJlw7CwUgJF5S4lkHJcbtGO_DRigx_NbS9AvrG6EJ00wfjkx-kWVZVE15BmYHN3_ozm1YRnLplSGyzieeaicuN20KcANCgJDEVcBmxymz-iLmEIots4UaqmHIIKAkxmjuxheZ0yPVbLnYp-RCotmY-vcJ7HrkZP1eEscmFSw=w640-h188)
  
  

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEixWVHgTOLCRjqy6kyGsjc-xAfX1nIFQZVDkAPHxZh4aHXcfH05PK1JXKmdzjwclYIkQz4qewFkXJreF12JeJn4FZtpJ3EpyIxQcul4wmFYuJUHe2U0VAbTtzEsVU1L6rKqa4jT8MdCQAgpURmM21YPqmA_RZsnuzrDnkZw8NnIaKIjBcMit4QCu4AT4g=w640-h200)

**Download & documentation here:**

- [Flutter Riverpod Snippets](https://marketplace.visualstudio.com/items?itemName=robert-brunhage.flutter-riverpod-snippets)

Do you prefer Flutter Bloc to Riverpod? Then [the bloc extension](https://marketplace.visualstudio.com/items?itemName=FelixAngelov.bloc)has you covered. 👍

## Error Lens

Do you want to know if you make mistakes as you type?

The [Error Lens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) extension improves the highlighting of errors, warnings, and other language diagnostics, and I find it immensely helpful:

[![](https://blogger.googleusercontent.com/img/a/AVvXsEhrRXNbPDumTsVzaBvlTIcdBsEcVfrwP0uvt751znlheK-TaJ9Tzp4bROxDg7Xg7qZ_IsVLtfLTvT7DvrzU7FXXKvBWchgVJoOo2_CCPJcaYmKA3WDyCROct9_Q8SQMApsC2qAs6K4TdAii5T1JNsDe6tE8RSy5PY12KpmJS14o6u8HO-sYBqaAeOGRVw=w640-h68)](https://blogger.googleusercontent.com/img/a/AVvXsEhrRXNbPDumTsVzaBvlTIcdBsEcVfrwP0uvt751znlheK-TaJ9Tzp4bROxDg7Xg7qZ_IsVLtfLTvT7DvrzU7FXXKvBWchgVJoOo2_CCPJcaYmKA3WDyCROct9_Q8SQMApsC2qAs6K4TdAii5T1JNsDe6tE8RSy5PY12KpmJS14o6u8HO-sYBqaAeOGRVw)

**Download here:**

[Error Lens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) (get any feedback about errors as you type: super useful)

## Better Comments

Improve your code comments by highlighting alerts, notes, TODOs, and more:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjqg14O75AJ28ucJsFqVC9ql7smZJEpMLVWUcRe9bzHLXImbYlOnrsGiE1hnOPgF3RSxVNng-YGEvB5dB58ho9aiMsfOFZuoaPuyhPizGw-Fb85KnuoddVKK5B7BzhR83uwxPomycWQDiR8jGzWUse0BkIptYKWX6k5nnc4FcCvB5LxUULGMpkL7n3hiA=w640-h176)

**Download here:**

- [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments)

## Remove comments

This is quite useful to remove all the default comments when you create a new Flutter project:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhAWwEHBruFf9n2Rb_Bkiptk3_MbXjnLBt3qxhrYM52b0gm-tOAEZKqsw3ZD7M9QkAHb7p6tZVQvRPu9ZRecRKcNQL65T8Tz2ZOpGre4P5gDtvw1NL9AmfJgPUtMgLiawgb0UgRQh5NFezxdxr1ZmVnYzHniRb_1_EWgzzW8QNp58eDyWZOH5oRsD1UCw=w640-h136)

Download here:

- [Remove Comments](https://marketplace.visualstudio.com/items?itemName=plibither8.remove-comments)

## Advanced New File

The usual way to create files is to select the folder you want in the sidebar, then click on "New File".

This is slow as it forces you to use the mouse. And for big projects, finding the correct folder can be challenging.

The Advanced New File extension lets you create files anywhere in your workspace, using your keyboard only.

You can run this from the command palette:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEh557CvGUs67QMmOvaZ2ds-auI1yNzrcbZauNdRpWHOd01uLZH6csA3DSqp-Al_hzxI2-bP5PRprBKMKrcYa40R_3a5UngbU_hWJGW3UJndDKzC1ro3BBC4QD1iNkMz20omaSNXJiMqYsf-88H2z6aZV-iyatUB7DAT3U-qG-ZdXj9LEFnh4tYwnmqU6Q=w640-h230)

Then, the extension will use pattern matching to help you find the folder you need as you type:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhsg3Zg__OHptK19ZFCCdD26yepTFbBXn-DUM3hx1UUnlpgnFjYltbKB5tcytCpA57KBgjmKzEhOGpo-U39Cu-ZYepR9dZJPw1jQfiAd5BQc8_Ge65ukV-3oWkNsFWNxm4utum6EbI66xjGdK_24XVIQSJfbXvLyGFFZUwwOmP7jWSdlj9EDGrcL1GVVg=w640-h302)

Finally, type the name of the file in the chosen folder:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEg1Ye-x1HEQ4odSbkJnigTXDe5qu6q3FbGeMz4CQBAFpuNDN8_g6XVxtR12mh2Zyv6zGrMlLQ5mg3SjPjzChiAkcxDlnCscNsbxPEJuKLfCUo1sh4AHlhaSNPwsVR3MFazHWI3CLe8FEsLBysEelMfJ1fkpWQi4fsWv-R7lIvwZ8ifkvKi6TJi2ecQxBA=w640-h118)

As a result, the extension will create an empty file in the right place and open it for you:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhGsmUXzxV10nQuQnsnmL_jbDludvfsAuSbD1Bja0A9i_XJEm1eSHYUwJej6mW9P7gFa69qTlrpe1U7sDgEz04EBoT4Wf21DDIDCoJAPzpCYY7C3jjtcj1Bs-mc9JPva4WPH9TEj5lf4xYYf3R7kwgjIGJWJyLXW_odmAgMp191vE9EP1cvtA3qGXJHiQ=w640-h152)

**Download here:**

- [Advanced New File](https://marketplace.visualstudio.com/items?itemName=patbenatar.advanced-new-file)

## GitHub Copilot

GitHub Copilot is an AI pair programmer which suggests line completions and entire function bodies as you type:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEir5oIUutuIK-6T1OPI5pn7m_GeXttydqdXKs-1kJKnir3mbc9qgUe37rf8hcVWZp-C_7TnFbZ94IGoZzsLGdTtOosZd97QGaQYSpuro-uscUJv-nHMF8p_NHPYnwCssbvmDfC1c_cYHikgbMxQrPnBkY6sJzVwh1-Ui8TfFsYx1SlgBMGfujtTY8Cw5A=w640-h300)

While it doesn't always get it right, I've been surprised at how much time it has saved me so far!

**Download here:**

- [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)

## Dracula's official theme (optional)

Of course, you're free to choose whichever theme you like best (as long as you use Dark Mode 😉).

Though this is my favorite:

- [Dracula official theme](https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula)

Another one I recommend is Monokai Pro (license required), which ships with a beautiful set of icons for common file extensions.

## Firebase Explorer

If you wanna see all your Firebase projects, Firestore data, Cloud Functions, and more without ever leaving VSCode, this one is for you:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEgcv3Z95s846jhKJvDLsvsfms_YUibB3ZTq07IEfv6gvz7bVmcuRQABRYU5pWXmepUnPF-EG3ndkd1QO_Tbyi_QA7TyugKxSeriTyAZ-5q2V4Iw1P0KzQ8IpegbCPVWWpXW8Gpxd4JrQoRSUj0TVl5uvnbkjP1AyTM0BBspHnZDms5qthsuiUqcHlF3_Q=w640-h622)

Download here:

- [Firebase Explorer](https://marketplace.visualstudio.com/items?itemName=jsayol.firebase-explorer)

## Version Lens

Ever wanted to see the latest available version of each package in your pubspec.yaml?

[Version Lens](https://marketplace.visualstudio.com/items?itemName=pflannery.vscode-versionlens) does just that, and you can use it to update each package with one click:

 ![](https://codewithandrea.com/articles/vscode-shortcuts-extensions-settings-flutter-development/images/version-lens.gif)

**Download here:**

- [Version Lens](https://marketplace.visualstudio.com/items?itemName=pflannery.vscode-versionlens)

## Useful Extensions for working with REST APIs

If your Flutter app connects to some REST APIs, these extensions will also be useful:

- [Rest Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client): send HTTP request and view the response in Visual Studio Code directly.

- [Thunder Client](https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client): a good alternative to Postman for managing all your REST API calls in VSCode.

- [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer): Launch a local development server with a live reload feature for static & dynamic pages.

# VSCode Settings for Flutter Development

In addition to all the great shortcuts and extensions, some Flutter-specific settings will help you a lot!

These can be set by opening Preferences: Open Settings (JSON) in the command palette:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEjoMD-04zrzJn4CEqc7ZLxvndxMI4VDTctxMFR2I3PdqpxczGvpzjMChMHBeeuVtJh5r42jgz1XrZU0DAKI7fPX18_WMxO3lXkiOmuAvFf6Nf55G5iiT1go35DqK7tgDfN-b7aqNixDgN_IwAM0b_wp2kC9Nrq3KAsk1KN1WVPwtEPsg29gAgjc3fr6PA=w640-h126)

The ones I find most useful are the options to fix all errors and format the code on save.

## Fix all errors on Save

I'm sure you got annoyed with the linter telling you to use const over and over:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhHM1c7jR8C5QPrDm8mtGBt_qC_B87FDIyjannxfgXKXiXgzk6-JKiCbZ9J92csftrJxRhwlDeOlPAy5nNJatvaivSdDlglSkKiQETF39xIkxu2bUjPPmkncLsGBU0vWmKPjWARb_8Efe2LP6pJTOgAnk0A4Q1wfS3minMkuy6_wQqaL6ecjJ_1jvxUUg=w640-h468)

Well, rather than fixing all these warnings by hand, just add this to your settings file:

```

"editor.codeActionsOnSave": { "source.fixAll": true}

```

And all the const errors (along with many others) will vanish when you save!

## Format on Save

When creating declarative layout, we often end up with unbalanced code or very long lines:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhcWhZBQQrYcx51Jklmwt-08s1w2OOAFvrB7nXS6fd7qv2Yip-09FpN8Tu33ONS5m5k0GIwTT--1KyQLVBRPBlc0Fh0e64enmehbKmWaFjv8fWoaXrZqXEbM22KiOSO38jxKBFSrJvU_aHhxVK18pidTP2RpsmkLC7goGEsee7ECHX1aidNK8dKL09K3Q=w640-h162)

To fix this, all we have to do is to add all the commas in the right places, then save the file:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEijBrUcWPWmhZqM-FVj2H5fBLLyc9UD0XJLKh3PHo23OSU6oQsBacT83OUuBz7Bu09z7bbNmkGh5uGF2w7_JpoByqBTaP_BrlWiK1XquMMUdU5aCe6zslFNKSSJ7Z8DVawVQpLnY-NXXRemyIheEy20LUBCXSBQNAM509Bu7onbHnP9-GChea2q3iZ7vA=w640-h426)

To enable the format on save, add this to the settings:

```

{ "editor.formatOnSave": true}

```

## Bracked Pair Colorization

A recent version of VSCode has introduced high-performance bracket pair colorization - a feature that is especially useful in Flutter.

All you have to do is to enable it:

```

{ "editor.bracketPairColorization.enabled": true}

```

And then you can enjoy all the colored brackets:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEgElh_KrOIZrp9mjZhlldxk7n_46x7k79aq8O3ofpJycl8vFVcEBH2S4aeWIEG7lurtrxSLnFrz0HE9L0PDdAmp2VYyB1y7AwdWlIDFNV30c01Xd0fTtrbJuj3h_qR6eJlzmLLoxHZQkiTBC4qc_o534radwZMh-nYBiXPIDj62LyR72QQeea4NgM3ZVQ=w640-h449)
  

More details here:

- [High-performance bracket pair colorization](https://code.visualstudio.com/updates/v1_60#_high-performance-bracket-pair-colorization)

## Preview Flutter UI Guides

Another setting I like a lot is called previewFlutterUiGuides, which can be enabled like this:

```

{ "dart.previewFlutterUiGuides": true}

```

With this in place, the editor will show some UI guides next to our widgets:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEhDQ9kJYwu6s3ZK3qI6aniqhb4pdslCy7XXnF0syxB0b_CtnkDhZpp8oB4cV0e9xVK4_DWD2YeuQZJMrG6Pdcy6nIn-ZDVxVpTAkyjswMH3nv0Lb5tAvwztKyZjpnRItWuCMIqndQggZJFHI-ILTfzbJYn28xdPeTjKTNlK-xrGpDhZzVPgRbEKYd1DDw=w640-h567)

## Enable Sticky Scroll

Use this setting to enable sticky scrolling on the current scope:

```

{ "editor.stickyScroll.enabled": true,}

```

Once this is set, the current class name and method will be pinned at the top of the editor while scrolling:

 ![](https://blogger.googleusercontent.com/img/a/AVvXsEiLuku04E2p7JeRwV_LDtwv1UmQt3ozU14rqMmWi0yPrgzoqLAzfBzDaxmR-b_G-7w-7Gkg_ohGYrRS17MAu_HIEBs_YTQ9cCvpT4drUbbv__L1T_Rmkvjoy31uJ3hgcH8Zeli4ait4mOt_6TYQgC_B65YiR2bmDDC3jPXmfyaJ_xoMAhFnN4QNSBHIJg=w640-h212)

## Enable file nesting for auto-generated Dart files

Do you have a lot of code-generated files and want to hide them by default in the project explorer?

Just enable file nesting in the VSCode settings like this:

```

{ "explorer.fileNesting.patterns": { "*.dart": "${capture}.g.dart, ${capture}.freezed.dart" }, "explorer.fileNesting.enabled": true, "explorer.fileNesting.expand": false,}

```

As a result, any generated files will be nested inside a toggle:

[![](https://blogger.googleusercontent.com/img/a/AVvXsEi_kwO2SKBOBnnnM7RDEggTnEjH_7M6awZQHpWPdUYLbk4d7D2Nd9hntYBxIGprlM6f-PaZG6dJqMFjgeMF30bIF-abWBJdUVEKBSvlWGnYddTrzclma1Hhp4AktqEEL60o78yawvhIU3P1c6CR1PUooQmIqY_HJFky6lrYjpKpTh6EwVoEgfEjQsPNiw=w640-h286)](https://blogger.googleusercontent.com/img/a/AVvXsEi_kwO2SKBOBnnnM7RDEggTnEjH_7M6awZQHpWPdUYLbk4d7D2Nd9hntYBxIGprlM6f-PaZG6dJqMFjgeMF30bIF-abWBJdUVEKBSvlWGnYddTrzclma1Hhp4AktqEEL60o78yawvhIU3P1c6CR1PUooQmIqY_HJFky6lrYjpKpTh6EwVoEgfEjQsPNiw)
  

Very useful if you use [build\_runner](https://pub.dev/packages/build_runner), [Freezed](https://pub.dev/packages/freezed), or [json\_serializable](https://pub.dev/packages/json_serializable) in your Flutter apps. 👌

## My settings.json file

Feel free to grab my own setup and customize it to your needs:

> 

```

{ "security.workspace.trust.enabled": false, "[dart]": { "editor.codeActionsOnSave": { "source.fixAll": true }, "editor.rulers": [80], "editor.selectionHighlight": false, "editor.suggest.snippetsPreventQuickSuggestions": false, "editor.suggestSelection": "first", "editor.tabCompletion": "onlySnippets", "editor.wordBasedSuggestions": false, }, "dart.warnWhenEditingFilesOutsideWorkspace": false, "dart.renameFilesWithClasses": "prompt", "window.zoomLevel": 1, "workbench.colorTheme": "Dracula", "editor.bracketPairColorization.enabled": true, "editor.inlineSuggest.enabled": true, "editor.formatOnSave": true, "editor.stickyScroll.enabled": true, "explorer.fileNesting.patterns": { "*.dart": "${capture}.g.dart, ${capture}.freezed.dart" }, "explorer.fileNesting.enabled": true, "explorer.fileNesting.expand": false}

```

## Bonus: Dart Fix

Have you ever returned to a Flutter project you haven't touched for one or two years, and found a bunch of deprecated warnings? (I'm looking at you, FlatButton and RaisedButton!)

Fear not, for you don't have to fix them all by hand.

Instead, all you have to do is run the dart fix on the terminal:

```
dart fix --dry-run # preview of the proposed changesdart fix --apply # apply the changes

```

More info is [on this page.](https://dart.dev/tools/dart-fix)

# Conclusion

I hope all the shortcuts, extensions, and settings above will boost your productivity!

Of course, there are many more tips and tricks you could learn about VSCode.

For that, I recommend this video by Fireship.io:

- [25 VS Code Productivity Tips and Speed Hacks](https://youtu.be/ifTF3ags0XI)

And if you want to go even more in-depth, you can check [this page](https://app.albera.com/u/alberatrees/vscode/) which contains a curated collection of the most popular VSCode videos.

Happy coding!