toJson method

Map<String, dynamic> toJson()

Produces a Map that can be serialized to JSON.

Implementation

Map<String, dynamic> toJson() {
  return {
    'trace_id': traceId.toString(),
    'public_key': publicKey,
    if (release != null) 'release': release,
    if (environment != null) 'environment': environment,
    if (userId != null) 'user_id': userId,
    if (userSegment != null) 'user_segment': userSegment,
    if (transaction != null) 'transaction': transaction,
    if (sampleRate != null) 'sample_rate': sampleRate,
    if (sampled != null) 'sampled': sampled,
  };
}