GroupDTO.fromJson constructor

GroupDTO.fromJson(
  1. Map<String, dynamic> json
)

Implementation

GroupDTO.fromJson(Map<String, dynamic> json)
    : members = json['members'] == null
          ? []
          : (json['members'] as List)
              .map((member) => MemberDTO.fromJson(member))
              .toList(),
      pendingMembers = json['pendingMembers'] == null
          ? []
          : (json['pendingMembers'] as List)
              .map((member) => MemberDTO.fromJson(member))
              .toList(),
      contractAddressERC20 = json['contractAddressERC20'],
      numberOfERC20 = json['numberOfERC20'],
      contractAddressNFT = json['contractAddressNFT'],
      numberOfNFTTokens = json['numberOfNFTTokens'],
      verificationProof = json['verificationProof'],
      groupImage = json['groupImage'],
      groupName = json['groupName'],
      isPublic = json['isPublic'],
      groupDescription = json['groupDescription'],
      groupCreator = json['groupCreator'],
      chatId = json['chatId'],
      scheduleAt = json['scheduleAt'] != null
          ? DateTime.parse(json['scheduleAt'])
          : null,
      scheduleEnd = json['scheduleEnd'] != null
          ? DateTime.parse(json['scheduleEnd'])
          : null,
      groupType = json['groupType'],
      meta = json['meta'],
      status = json['status'] != null
          ? chatStatusFromString(json['status'])
          : null;