report method

  1. @override
Future<void> report(
  1. Iterable<UnusedFilesFileReport> records, {
  2. Iterable<void> summary = const [],
  3. UnusedFilesReportParams? additionalParams,
})
override

Implementation

@override
Future<void> report(
  Iterable<UnusedFilesFileReport> records, {
  Iterable<void> summary = const [],
  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);
}