report method

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

Implementation

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

  final encodedReport = json.encode({
    'formatVersion': formatVersion,
    'timestamp': getTimestamp(),
    'unnecessaryNullable':
        records.map(_unnecessaryNullableFileReportToJson).toList(),
  });

  output.write(encodedReport);
}