dart_builder 2.0.0-alpha.3 dart_builder: ^2.0.0-alpha.3 copied to clipboard
A fluent immutable API for creating Dart code.
Dart Builder #
Introduction #
A fluent, immutable API for creating Dart code.
Each of the core classes is split into two: a mutable builder and an immutable "built" class. Builders are for computation, "built" classes are for safely sharing with no need to copy defensively.
Design #
All of the "built" files are:
- Immutable using the
const
constructor or a "builder" class - Hashable
- Implement deep equality
Concepts #
Will need to be expanded on (docs, examples), but here are some of the common data structures provided:
You may also be interested in the SourceWriter, which produces raw Dart code (text) from these data structures. Eventually it will be integrated with dartfmt
and be possible to integrate into a processing pipeline.