toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json.addAll({
    'samplePeriod': samplePeriod,
    'maxStackDepth': maxStackDepth,
    'sampleCount': sampleCount,
    'timeSpan': timeSpan,
    'timeOriginMicros': timeOriginMicros,
    'timeExtentMicros': timeExtentMicros,
    'pid': pid,
    'functions': functions?.map((f) => f.toJson()).toList(),
    'samples': samples?.map((f) => f.toJson()).toList(),
  });
  return json;
}