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());
  return json;
}