有没有办法将生成的文件放在一个单独的文件夹中?

Is there a way to put the generated files in a separate folder in flutter?

在我的应用程序中,我使用 json_serializable 冻结。在我放置所有数据模型的文件夹中,有很多生成的文件,例如 model.g.dartmodel.freeezed.dart。是否有可能将所有生成的文件移动到项目中的单独文件夹中,例如 generated?

根据build_runner documentation

flutter pub run build_runner build --output <dirname>

flutter pub run build_runner build --output models:<directory name>

仅输出 models 目录