nithinTa
nithinTa

Reputation: 1642

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

I can do region blocks in android studio like this.

//region Description

Your code here

//endregion

But how to the same with flutter ?

Upvotes: 3

Views: 6415

Answers (1)

alex_c137
alex_c137

Reputation: 1904

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#`
         ...
     }
}

Upvotes: 7

Related Questions