emit method

  1. @override
void emit(
  1. List<Allocation> leaks
)
override

Writes all leaks to disk as formatted JSON.

Existing files will be overwritten.

Implementation

@override
void emit(List<Allocation> leaks) {
  final jsonList = leaks.map((allocation) => allocation.toJson()).toList();
  final jsonString = _jsonEncoder.convert(jsonList);
  File(filePath).writeAsStringSync(jsonString);
}