SharedPartBuilder constructor
SharedPartBuilder(})
Wrap generators as a Builder that generates part of files.
partId indicates what files will be created for each .dart
input. This extension should be unique as to not conflict with other
SharedPartBuilders. The resulting file will be of the form
<generatedExtension>.g.part. If any generator in generators 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.
allowSyntaxErrors indicates whether to allow syntax errors in input
libraries.
Implementation
SharedPartBuilder(
super.generators,
String partId, {
super.formatOutput,
super.additionalOutputExtensions,
super.allowSyntaxErrors,
}) : super(
generatedExtension: '.$partId.g.part',
header: '',
) {
if (!_partIdRegExp.hasMatch(partId)) {
throw ArgumentError.value(
partId,
'partId',
'`partId` can only contain letters, numbers, `_` and `.`. '
'It cannot start or end with `.`.',
);
}
}