@@ -57,16 +57,15 @@ class _Builder extends Builder {
5757 bool ? writeDescriptions,
5858 this .allowSyntaxErrors = false ,
5959 BuilderOptions ? options,
60- }) : _generatedExtension = generatedExtension,
61- buildExtensions = validatedBuildExtensionsFrom (
62- options != null ? Map .of (options.config) : null , {
63- '.dart' : [
64- generatedExtension,
65- ...additionalOutputExtensions,
66- ],
67- }),
68- _writeDescriptions = writeDescriptions ?? true ,
69- _header = (header ?? defaultFileHeader).trim () {
60+ }) : _generatedExtension = generatedExtension,
61+ buildExtensions = validatedBuildExtensionsFrom (
62+ options != null ? Map .of (options.config) : null ,
63+ {
64+ '.dart' : [generatedExtension, ...additionalOutputExtensions],
65+ },
66+ ),
67+ _writeDescriptions = writeDescriptions ?? true ,
68+ _header = (header ?? defaultFileHeader).trim () {
7069 if (_generatedExtension.isEmpty || ! _generatedExtension.startsWith ('.' )) {
7170 throw ArgumentError .value (
7271 _generatedExtension,
@@ -102,8 +101,10 @@ class _Builder extends Builder {
102101 return ;
103102 }
104103
105- final lib = await buildStep.resolver
106- .libraryFor (buildStep.inputId, allowSyntaxErrors: allowSyntaxErrors);
104+ final lib = await buildStep.resolver.libraryFor (
105+ buildStep.inputId,
106+ allowSyntaxErrors: allowSyntaxErrors,
107+ );
107108 await _generateForLibrary (lib, buildStep);
108109 }
109110
@@ -138,10 +139,13 @@ class _Builder extends Builder {
138139 ..writeln ('part of \' $partOfUri \' ;' );
139140 final part = computePartUrl (buildStep.inputId, outputId);
140141
141- final libraryUnit =
142- await buildStep.resolver.compilationUnitFor (buildStep.inputId);
143- final hasLibraryPartDirectiveWithOutputUri =
144- hasExpectedPartDirective (libraryUnit, part);
142+ final libraryUnit = await buildStep.resolver.compilationUnitFor (
143+ buildStep.inputId,
144+ );
145+ final hasLibraryPartDirectiveWithOutputUri = hasExpectedPartDirective (
146+ libraryUnit,
147+ part,
148+ );
145149 if (! hasLibraryPartDirectiveWithOutputUri) {
146150 // TODO: Upgrade to error in a future breaking change?
147151 log.warning (
@@ -163,8 +167,9 @@ class _Builder extends Builder {
163167 ..writeln ()
164168 ..writeln (_headerLine)
165169 ..writeAll (
166- LineSplitter .split (item.generatorDescription)
167- .map ((line) => '// $line \n ' ),
170+ LineSplitter .split (
171+ item.generatorDescription,
172+ ).map ((line) => '// $line \n ' ),
168173 )
169174 ..writeln (_headerLine)
170175 ..writeln ();
@@ -176,8 +181,10 @@ class _Builder extends Builder {
176181 var genPartContent = contentBuffer.toString ();
177182
178183 try {
179- genPartContent =
180- formatOutput (genPartContent, library.languageVersion.effective);
184+ genPartContent = formatOutput (
185+ genPartContent,
186+ library.languageVersion.effective,
187+ );
181188 } catch (e, stack) {
182189 log.severe (
183190 '''
@@ -240,10 +247,7 @@ class SharedPartBuilder extends _Builder {
240247 super .additionalOutputExtensions,
241248 super .allowSyntaxErrors,
242249 super .writeDescriptions,
243- }) : super (
244- generatedExtension: '.$partId .g.part' ,
245- header: '' ,
246- ) {
250+ }) : super (generatedExtension: '.$partId .g.part' , header: '' ) {
247251 if (! _partIdRegExp.hasMatch (partId)) {
248252 throw ArgumentError .value (
249253 partId,
@@ -304,9 +308,7 @@ class PartBuilder extends _Builder {
304308 super .header,
305309 super .allowSyntaxErrors,
306310 super .options,
307- }) : super (
308- generatedExtension: generatedExtension,
309- );
311+ }) : super (generatedExtension: generatedExtension);
310312}
311313
312314/// A [Builder] which generates standalone Dart library files.
0 commit comments