toJson method

Map<String, dynamic> toJson()

Serializes to a JSON map with the type discriminator (pi shape).

Implementation

Map<String, dynamic> toJson() => {
  'type': type,
  'id': id,
  'parentId': parentId,
  'timestamp': timestamp.toIso8601String(),
  ...payloadJson(),
};