英文:
Flutter formater on VSCode Mac
问题
I just tried flutter in VSCode
I'm confused when the file is saved, why is the closing tag always one line
this is after I save the file:
is there any extension or some settings to make as like my expectation?
thanks
英文:
I just tried flutter in VSCode
I'm confused when the file is saved, why is the closing tag always one line
this is after I save the file:
is there any extension or some settings to make as like my expectation?
thanks
答案1
得分: 1
你的设置是正确的。这将使Dart在保存文件时真正格式化您的代码。
但是,如果您想让这种格式化换行,Dart希望在闭括号后看到一个逗号。例如:
...
backgroundColor: Colors.blueGrey[900],),),);
这样做,当您保存时,它将按您想要的方式格式化。
英文:
Your settings are right. This will make Dart really format your code when you save a file.
But if you want to this format break the lines, Dart expects to se a comma after the closing brackets. Example:
...
backgroundColor: Colors.blueGrey[900],),),);
Doing this, when you save, it will be formatted the way you want to.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论