convert2DartTopicInfo static method

Future<V2TimTopicInfo> convert2DartTopicInfo(
  1. Map<String, dynamic> json
)

Implementation

static Future<V2TimTopicInfo> convert2DartTopicInfo(Map<String, dynamic> json) async {
  List<Map<String, dynamic>> atList = List.empty(growable: true);
  if (json["group_topic_info_group_at_info_array"] != null) {
    List<Map<String, dynamic>> nativeLits = List<Map<String, dynamic>>.from(json["group_topic_info_group_at_info_array"]);
    for (var element in nativeLits) {
      atList.add(Tools.convert2GroupAtInfo(element).toJson());
    }
  }
  return V2TimTopicInfo.fromJson({
    "topicID": json["group_topic_info_topic_id"],
    "topicName": json["group_topic_info_topic_name"],
    "topicFaceUrl": json["group_topic_info_topic_face_url"],
    "introduction": json["group_topic_info_introduction"],
    "notification": json["group_topic_info_notification"],
    "isAllMute": json["group_topic_info_is_all_muted"],
    "selfMuteTime": json["group_topic_info_self_mute_time"],
    "customString": json["group_topic_info_custom_string"],
    "recvOpt": json["group_topic_info_recv_opt"],
    "draftText": json["group_topic_info_draft_text"],
    "unreadCount": json["group_topic_info_unread_count"],
    "lastMessage": json["group_topic_info_last_message"] != null ? (await Tools.convertMessage2Dart(json["group_topic_info_last_message"])).toJson() : null,
    "groupAtInfoList": atList,
  });
}