toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json.addAll({
    'scriptIndex': scriptIndex,
    'startPos': startPos,
    'endPos': endPos,
    'compiled': compiled,
  });
  _setIfNotNull(json, 'error', error?.toJson());
  _setIfNotNull(json, 'coverage', coverage?.toJson());
  _setIfNotNull(json, 'possibleBreakpoints',
      possibleBreakpoints?.map((f) => f).toList());
  _setIfNotNull(json, 'branchCoverage', branchCoverage?.toJson());
  return json;
}