Based on one of the comments, I found a usable way to fold generated files under the original .dart file in Jetbrains (e.g. Intellij Idea).
In your Project view, select the "Options" vertical '...' icon.
In the dropdown, select "Appearance", then "File Nesting..."
Under the relevant file type (e.g. '.dart'), add associated generated or "child" file extensions to the list. For example, .g.dart for riverpod or .freezed.dart for freezed. Save / accept your changes.