在团队中使用 flutter 中的代码生成来生成生产代码?

Use of code generation in flutter for production code among a team?

是否可以指定单个文件到flutter package pub run build runner

来自 build_runner build --help 输出:

--build-filter                  An explicit filter of files to build.
                                    Relative paths and `package:` uris are
                                    supported, including glob syntax for paths
                                    portions (but not package names).

他们的更新日志中有一个例子:

Example: The following would build and serve the JS output for an application, as well as copy over the required SDK resources for that app:

pub run build_runner serve \
  --build-filter="web/main.dart.js" \
  --build-filter="package:build_web_compilers/**/*.js"

https://pub.dev/packages/build_runner/changelog#170