groupDetail2DartGroupInfo static method

V2TimGroupInfo groupDetail2DartGroupInfo(
  1. dynamic jsonInfo
)

Implementation

static V2TimGroupInfo groupDetail2DartGroupInfo(jsonInfo) {
  if (jsonInfo == null) {
    return V2TimGroupInfo(groupID: '', groupType: '');
  }
  // late int? role;
  // late int? recvOpt;
  // late int? joinTime;
  // Map<String, String>? customInfo;
  return V2TimGroupInfo.fromJson({
    "groupID": jsonInfo["group_detail_info_group_id"],
    "groupType": groupType2Dart(jsonInfo["group_detail_info_group_type"]),
    "groupName": jsonInfo["group_detail_info_group_name"],
    "notification": jsonInfo["group_detail_info_notification"],
    "introduction": jsonInfo["group_detail_info_introduction"],
    "faceUrl": jsonInfo["group_detail_info_face_url"],
    "isAllMuted": jsonInfo["group_detail_info_is_shutup_all"],
    "isSupportTopic": jsonInfo["group_detail_info_is_support_topic"],
    "owner": jsonInfo["group_detail_info_owener_identifier"],
    "createTime": jsonInfo["group_detail_info_create_time"],
    "groupAddOpt": jsonInfo["group_detail_info_add_option"],
    "lastInfoTime": jsonInfo["group_detail_info_last_info_time"],
    "lastMessageTime": jsonInfo["group_detail_info_last_msg_time"],
    "memberCount": jsonInfo["group_detail_info_member_num"],
    "onlineCount": jsonInfo["group_detail_info_online_member_num"],
    "role": Map<String, dynamic>.from(jsonInfo["group_base_info_self_info"] ?? {})["group_self_info_role"],
    "recvOpt": Map<String, dynamic>.from(jsonInfo["group_base_info_self_info"] ?? {})["group_self_info_msg_flag"],
    "joinTime": Map<String, dynamic>.from(jsonInfo["group_base_info_self_info"] ?? {})["group_self_info_join_time"],
    "customInfo": convert2DartMap(
      jsonInfo["group_detail_info_custom_info"],
      "group_info_custom_string_info_key",
      "group_info_custom_string_info_value",
    ),
  });
}