toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  data['content'] = content;

  if (type == MessageType.META) {
    data['info'] = info?.toJson();
  }

  if (type == MessageType.REACTION) {
    data['reference'] = reference;
  }

  return data;
}