fromEntity static method

Future<PublicMediumModel?> fromEntity(
  1. String documentID,
  2. PublicMediumEntity? entity
)

Implementation

static Future<PublicMediumModel?> fromEntity(
    String documentID, PublicMediumEntity? entity) async {
  if (entity == null) return null;
  return PublicMediumModel(
    documentID: documentID,
    authorId: entity.authorId ?? '',
    base: entity.base,
    ext: entity.ext,
    url: entity.url,
    ref: entity.ref,
    urlThumbnail: entity.urlThumbnail,
    refThumbnail: entity.refThumbnail,
    mediumType: toPublicMediumType(entity.mediumType),
    mediumWidth: entity.mediumWidth,
    mediumHeight: entity.mediumHeight,
    thumbnailWidth: entity.thumbnailWidth,
    thumbnailHeight: entity.thumbnailHeight,
    relatedMediumId: entity.relatedMediumId,
  );
}