applyDartFixes function
Runs dart fix --apply
in the outputDir
.
Implementation
Future<void> applyDartFixes(
Logger logger,
Directory outputDir, {
bool recursive = false,
}) async {
final isDartInstalled = await Dart.installed(logger: logger);
if (isDartInstalled) {
final applyFixesProgress = logger.progress(
'Running "dart fix --apply" in ${outputDir.path}',
);
await Dart.applyFixes(
cwd: outputDir.path,
recursive: recursive,
logger: logger,
);
applyFixesProgress.complete();
}
}