toJson method

  1. @override
Map<String, Object?> toJson()
override

Implementation

@override
Map<String, Object?> toJson() {
  final data = super.toJson();
  data['event_id'] = eventId;
  data['origin_server_ts'] = originServerTs.millisecondsSinceEpoch;
  if (unsigned != null) {
    data['unsigned'] = unsigned;
  }
  if (prevContent != null) {
    data['prev_content'] = prevContent;
  }
  if (roomId != null) {
    data['room_id'] = roomId;
  }
  if (data['state_key'] == null) {
    data.remove('state_key');
  }
  if (redacts != null) {
    data['redacts'] = redacts;
  }
  return data;
}