How to remove warning text beside my code in Flutter's Visual Studio Code

Viewed 208

I am a new Flutter learner, and this is kinda annoy me, I think the "Problems" tab under is fully understand, I don't want to see warning next to my code. Is there a way I can disable or hide it? Thank you.

enter image description here

2 Answers

Hey, In visual studio code you can do minute changes.

Step1:

Press ctrl+shift+p , a command pallet will open enter image description here

Step2:

Type settings.json and click on Open Settings (JSON) a file will open enter image description here

step3:

Add this lines in that

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

**After this whenever you save, const will be added automatically.

Note: Sometimes you might get error because after saving some widgets are prefixed with const but, sometimes when your values in widget get dynamic, there will be a error, so be careful.

enter image description here

disable this line or add source.fixAll to config.json

Related