fromEntity static method

Future<ChatMemberInfoModel?> fromEntity(
  1. String documentID,
  2. ChatMemberInfoEntity? entity
)

Implementation

static Future<ChatMemberInfoModel?> fromEntity(
    String documentID, ChatMemberInfoEntity? entity) async {
  if (entity == null) return null;
  return ChatMemberInfoModel(
    documentID: documentID,
    authorId: entity.authorId ?? '',
    appId: entity.appId ?? '',
    roomId: entity.roomId,
    timestamp: entity.timestamp == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((entity.timestamp as int)),
    accessibleByGroup:
        toChatMemberInfoAccessibleByGroup(entity.accessibleByGroup),
    accessibleByMembers: entity.accessibleByMembers,
    readAccess: entity.readAccess,
  );
}