LibraryBuilder constructor
LibraryBuilder(})
Wrap generator
as a Builder
that generates Dart library files.
generatedExtension
indicates what files will be created for each .dart
input.
Defaults to .g.dart
, however this should usually be changed to
avoid conflicts with outputs from a SharedPartBuilder.
If generator
will create additional outputs through the BuildStep
they
should be indicated in additionalOutputExtensions
.
formatOutput
is called to format the generated code. Defaults to
DartFormatter.format
.
header
is used to specify the content at the top of each generated file.
If null
, the content of defaultFileHeader is used.
If header
is an empty String
no header is added.
allowSyntaxErrors
indicates whether to allow syntax errors in input
libraries.
Implementation
LibraryBuilder(
Generator generator, {
String Function(String code)? formatOutput,
String generatedExtension = '.g.dart',
List<String> additionalOutputExtensions = const [],
String? header,
bool allowSyntaxErrors = false,
BuilderOptions? options,
}) : super(
[generator],
formatOutput: formatOutput,
generatedExtension: generatedExtension,
additionalOutputExtensions: additionalOutputExtensions,
header: header,
allowSyntaxErrors: allowSyntaxErrors,
options: options,
);