report method

  1. @override
Future<void> report(
  1. Iterable<UnusedFilesFileReport> records, {
  2. UnusedFilesReportParams? additionalParams,
})
override

Implementation

@override
Future<void> report(
  Iterable<UnusedFilesFileReport> records, {
  UnusedFilesReportParams? additionalParams,
}) async {
  if (records.isEmpty) {
    return;
  }

  final encodedReport = json.encode({
    'formatVersion': formatVersion,
    'timestamp': getTimestamp(),
    'unusedFiles': records.map(_analysisRecordToJson).toList(),
    'automaticallyDeleted': additionalParams?.deleteUnusedFiles ?? false,
  });

  output.write(encodedReport);
}