How to do Region Blocks for Code Folding in android studio with Flutter

六月ゝ 毕业季﹏ 提交于 2020-12-15 05:48:52

问题


I can do region blocks in android studio like this.

//region Description

Your code here

//endregion

But how to the same with flutter ?


回答1:


In the IntelliJ or Android Studio IDE, you can use REGION folding as written in your question, works fine. REGION folding also works with //#region (both tested in the IntelliJ IDE CE 2019.3.3 and Android Studio IDE 3.4.1):

// with and without spaces after double slashes
//#region Description
Your code here
//#endregion

// #region Description
Your code here
// #endregion

This was also described in the Dart-Code/Dart-Code repository in this issue at GitHub

Off topic: If someone else prefers to use VSCode then I can recommend the extension #region folding for VS Code. There you can configure the folding comment for each language as you wish.

"maptz.regionfolder": {
     "[dart]": {
         "foldStart": "// #region [NAME]", // or whatever you like, e.g.`// #some_tag#`
         ...
     }
}


来源:https://stackoverflow.com/questions/61029211/how-to-do-region-blocks-for-code-folding-in-android-studio-with-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!