Search code examples
android-studioflutterintellij-idea

flatten / group generated files in android studio flutter project


Coming from PHPStorm the IDE by default folds / collapses similar files to one level.

So for example when I have a file.ts and file.js in the same folder, file.js will be hidden in a dropdown below file.ts because PHPStorm knows its generated and assumes the files are related.

Is there a similiar feature in Android Studio when using Flutter?

I want to group / collapse my .freezed.dart and .g.dart files so they are hidden from the project view but not ignored.


Solution

  • File nesting rules | IntelliJ IDEA Documentation

    This works for all IntelliJ-based IDEs.

    1. In the Project tool window (Alt+1), open options.

    new UI: new UI

    old UI: old UI

    1. Select File Nesting. A dialog opens in which you can configure file nesting rules.

    2. Add new rules:

    .freezed.dart; .g.dart;
    

    rules