fromMap static method

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

Implementation

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

  return MemberMediumEntity(
    appId: map['appId'],
    authorId: map['authorId'],
    base: map['base'],
    ext: map['ext'],
    url: map['url'],
    ref: map['ref'],
    urlThumbnail: map['urlThumbnail'],
    refThumbnail: map['refThumbnail'],
    accessibleByGroup: map['accessibleByGroup'],
    accessibleByMembers: map['accessibleByMembers'] == null
        ? null
        : List.from(map['accessibleByMembers']),
    readAccess:
        map['readAccess'] == null ? null : List.from(map['readAccess']),
    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'],
  );
}