In Visual Studio Code, how can you automatically add const when you press (Ctrl + S)?
To add an auto const feature when you save the file in Flutter in Visual Studio Code, you should follow these steps:
Press (Ctrl + P) then search for (settings.json) file.
Add this code line to there;
"editor.codeActionsOnSave": {
"source.fixAll": true
}
Open the User Settings(Json)

Add the following code
"editor.codeActionsOnSave": {
"source.fixAll": true
}
Note: It is a simplified and updated version of Emirhan's answer with required changes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With