LibraryBuilder class

A Builder which generates standalone Dart library files.

A single Generator is responsible for generating the entirety of the output since it must also output any relevant import directives at the beginning of it's output.


LibraryBuilder(Generator generator, {String formatOutput(String code), String generatedExtension = '.g.dart', List<String> additionalOutputExtensions = const [], String header, bool allowSyntaxErrors = false})
Wrap generator as a Builder that generates Dart library files. [...]


allowSyntaxErrors → bool
Whether to allow syntax errors in input libraries.
final, inherited
buildExtensions → Map<String, List<String>>
Mapping from input file extension to output file extensions. [...]
final, inherited
formatOutput → String Function(String)
Function that determines how the generated code is formatted.
final, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


build(BuildStep buildStep) → Future
Generates the outputs for a given BuildStep.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() → String
Returns a string representation of this object.


operator ==(Object other) → bool
The equality operator. [...]