我可以像这样在 android studio 中做区域 block 。
//region Description
Your code here
//endregion
但是如何与 flutter 一样呢?
最佳答案
在 IntelliJ 或 Android Studio IDE 中,您可以按照问题中的说明使用 REGION 折叠,效果很好。
REGION 折叠也适用于 //#region
(均在 IntelliJ IDE CE 2019.3.3 和 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 issue at GitHub 中的 Dart-Code/Dart-Code 存储库中进行了描述。
题外话: 如果其他人更喜欢使用 VSCode,那么我可以推荐扩展 #region folding for VS Code .在那里您可以根据需要为每种语言配置折叠注释。
"maptz.regionfolder": {
"[dart]": {
"foldStart": "// #region [NAME]", // or whatever you like, e.g.`// #some_tag#`
...
}
}
关于android-studio - 如何使用 Flutter 在 android studio 中为代码折叠做区域 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61029211/