ChatGroup.fromJson constructor

ChatGroup.fromJson(
  1. Map map
)

Implementation

factory ChatGroup.fromJson(Map map) {
  String groupId = map['groupId'];
  String? groupName = map["name"];
  String? avatarUrl = map["avatarUrl"];
  String? desc = map["desc"];
  String? owner = map["owner"];
  String? announcement = map["announcement"];
  int? memberCount = map["memberCount"];
  List<String>? memberList = map.getList("memberList");
  List<String>? adminList = map.getList("adminList");
  List<String>? blockList = map.getList("blockList");
  List<String>? muteList = map.getList("muteList");
  bool? messageBlocked = map["messageBlocked"];
  bool? isAllMemberMuted = map["isAllMemberMuted"];
  ChatGroupPermissionType? permissionType =
      ChatGroupPermissionTypeExtension.values(map['permissionType']);
  int? maxUserCount = map["maxUserCount"];
  bool? isPublic = map["isPublic"];
  bool? isJoinApprovalRequired = map["isJoinApprovalRequired"];
  bool? isMemberAllowToInvite = map["isMemberAllowToInvite"];
  bool? isDisabled = map["isDisabled"];
  String? extension = map["ext"];
  ChatGroupConfigs? configs = map['configs'] == null
      ? null
      : ChatGroupConfigs.fromJson(map['configs']);

  return ChatGroup(
    groupId: groupId,
    avatarUrl: avatarUrl,
    groupName: groupName,
    desc: desc,
    owner: owner,
    announcement: announcement,
    memberCount: memberCount,
    memberList: memberList,
    adminList: adminList,
    blockList: blockList,
    muteList: muteList,
    messageBlocked: messageBlocked,
    isAllMemberMuted: isAllMemberMuted,
    permissionType: permissionType,
    maxUserCount: maxUserCount,
    isPublic: isPublic,
    isJoinApprovalRequired: isJoinApprovalRequired,
    isMemberAllowToInvite: isMemberAllowToInvite,
    extension: extension,
    configs: configs,
    isDisabled: isDisabled ?? false,
  );
}