SentryTraceContext.fromJson constructor

SentryTraceContext.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SentryTraceContext.fromJson(Map<String, dynamic> json) {
  return SentryTraceContext(
    operation: json['op'] as String,
    spanId: SpanId.fromId(json['span_id'] as String),
    parentSpanId: json['parent_span_id'] == null
        ? null
        : SpanId.fromId(json['parent_span_id'] as String),
    traceId: SentryId.fromId(json['trace_id'] as String),
    description: json['description'] as String?,
    status: json['status'] == null
        ? null
        : SpanStatus.fromString(json['status'] as String),
    sampled: true,
    origin: json['origin'] == null ? null : json['origin'] as String?,
  );
}