skip to Main Content

In VS Code, how to add automatically const when you press (ctrl + s) ?

2

Answers


  1. Chosen as BEST ANSWER

    **To Add auto const feature when you save the file in Flutter in VS Code, you should follow these steps: **

    1-) press (ctrl + P) then search for (settings.json) file.

    2-) Add this code line to there;

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

    • Press ctrl+ shift+ P
    • Search settings.json
      • Open the User Settings(Json)
        enter image description here

      • Add the following code

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

    Note: simplified and updated @Emirhan’s answer with required changes

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