decode method

  1. @override
void decode(
  1. String content
)
override

Implementation

@override
void decode(String content) {
  Map map = json.decode(content);
  int conversationType = map['conversationType'];
  String conversationId = map['conversationId'];
  conversation = Conversation(conversationType, conversationId);
  title = map['title'] ?? '';
  if (map['messageIdList'] != null) {
    List<Object?> sourceList = map['messageIdList'];
    messageIdList = sourceList.map((item) => item.toString()).toList();
  }
  if (map['previewList'] != null) {
    List<MergeMessagePreviewUnit> l = [];
    for (Map<String, dynamic> unitMap in map['previewList']) {
      MergeMessagePreviewUnit unit = MergeMessagePreviewUnit.fromMap(unitMap);
      l.add(unit);
    }
    previewList = l;
  }
  extra = map['extra'] ?? '';
  containerMsgId = map['containerMsgId'] ?? '';
}