fromEntityPlus static method

Future<RoomModel?> fromEntityPlus(
  1. String documentID,
  2. RoomEntity? entity, {
  3. String? appId,
})

Implementation

static Future<RoomModel?> fromEntityPlus(
    String documentID, RoomEntity? entity,
    {String? appId}) async {
  if (entity == null) return null;

  return RoomModel(
    documentID: documentID,
    ownerId: entity.ownerId ?? '',
    appId: entity.appId ?? '',
    description: entity.description,
    isRoom: entity.isRoom,
    members: entity.members,
    timestamp: entity.timestamp == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch((entity.timestamp as int)),
  );
}