fromMap static method

PublicMediumEntity? fromMap(
  1. Object? o, {
  2. Map<String, String>? newDocumentIds,
})

Implementation

static PublicMediumEntity? fromMap(Object? o,
    {Map<String, String>? newDocumentIds}) {
  if (o == null) return null;
  var map = o as Map<String, dynamic>;

  return PublicMediumEntity(
    authorId: map['authorId'],
    base: map['base'],
    ext: map['ext'],
    url: map['url'],
    ref: map['ref'],
    urlThumbnail: map['urlThumbnail'],
    refThumbnail: map['refThumbnail'],
    mediumType: map['mediumType'],
    mediumWidth: int.tryParse(map['mediumWidth'].toString()),
    mediumHeight: int.tryParse(map['mediumHeight'].toString()),
    thumbnailWidth: int.tryParse(map['thumbnailWidth'].toString()),
    thumbnailHeight: int.tryParse(map['thumbnailHeight'].toString()),
    relatedMediumId: map['relatedMediumId'],
  );
}