LibraryBuilder class

A specialized Builder that generates Dart library files.

This builder creates standalone Dart files that aren't part files. Each output file will include a header and can include generator descriptions.

Inheritance

Constructors

LibraryBuilder(Generator generator, {String formatOutput(String code) = _defaultFormatOutput, required Set<String> outputExtensions, bool? writeDescriptions, String? header, bool allowSyntaxErrors = false, BuilderOptions? options})
Creates a builder that generates standalone Dart library files.

Properties

allowSyntaxErrors → bool
Whether to continue processing even when syntax errors are present in input libraries.
finalinherited
formatOutput → String Function(String code)
Function that determines how the generated code is formatted.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
outputExtensions ↔ Set<String>
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildStep buildStep) → Future<void>
Generates the outputs for a given BuildStep.
inherited
generateForLibrary(LibraryElement library, BuildStep buildStep) → Future<void>
Generates code for the given library using all registered generators.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldBuildFor(BuildCandidate candidate) → bool
This is used to determine if the builder should be run for a given BuildCandidate.
inherited
toString() → String
A string representation of this object.
inherited
writeOutput(BuildStep buildStep, String content, String extension) → FutureOr<void>
Formats and writes the generated content to the output file.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited