source_gen
source_gen is a framework and a convention for writing Dart source code generators, so multiple generators from different packages can produce code into the same project without clashing.
source_gen provides utilities for automated source code generation in Dart. It is both a framework for writing Builders that consume and produce Dart code, and a convention that lets hand-written and generated Dart code live side by side with a clean separation, so generators from different packages can integrate in the same project.
Its main purpose is to expose a developer-friendly API on top of lower-level packages such as the analyzer and build packages, though a project can use those packages directly instead of source_gen. A generator is written by extending its Generator or GeneratorForAnnotation classes, which are then called for a Dart library, or for each annotated element within one.
source_gen builds on the build package and offers several Builder types: a SharedPartBuilder for the conventional shared part-file output that several packages can contribute to, a PartBuilder for a package's own uniquely named part files, and a LibraryBuilder for a standalone, importable generated library.