Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
MohiuddinM committed Jan 13, 2025
1 parent 3b0a610 commit 5843205
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ class YamlBasedBuilder implements Builder {
var dartContent = generateDartContentFromYaml(objectName, contents);

try {
var version = Platform.version;
dartContent = DartFormatter(languageVersion: Version.parse(version))
.format(dartContent);
final version = Platform.version;
final formatter = DartFormatter(languageVersion: Version.parse(version));
dartContent = formatter.format(dartContent);
} on FormatterException {
log.warning(
'Could not format generated output, it might contain errors.',
);
}

var copy = currentFile.changeExtension('.dart');
final copy = currentFile.changeExtension('.dart');

// Write out the new asset.
await buildStep.writeAsString(copy, dartContent);
Expand Down

0 comments on commit 5843205

Please sign in to comment.