PartBuilder class

A Builder which generates part of files.

This builder should be avoided - prefer using SharedPartBuilder and generating content that can be merged with output from other builders into a common .g.dart part file.

Each output should correspond to a part directive in the primary input, this will be validated.

Content output by each generator is concatenated and written to the output. A part of directive will automatically be included in the output and should not need be written by any of the generators.

Constructors

PartBuilder(List<Generator> generators, String generatedExtension, {String formatOutput(String code)?, List<String> additionalOutputExtensions = const [], String? header, bool allowSyntaxErrors = false, BuilderOptions? options})
Wrap generators as a Builder that generates part of files.

Properties

allowSyntaxErrors bool
Whether to allow syntax errors in input libraries.
finalinherited
buildExtensions Map<String, List<String>>
finalinherited
formatOutput String Function(String)
Function that determines how the generated code is formatted.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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