fromEntity static method

Future<RoomModel?> fromEntity(
  1. String documentID,
  2. RoomEntity? entity
)

Implementation

static Future<RoomModel?> fromEntity(
    String documentID, RoomEntity? entity) 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)),
  );
}