fromMap static method

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

Implementation

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

  var mediumIdNewDocmentId = map['mediumId'];
  if ((newDocumentIds != null) && (mediumIdNewDocmentId != null)) {
    var mediumIdOldDocmentId = mediumIdNewDocmentId;
    mediumIdNewDocmentId = newRandomKey();
    newDocumentIds[mediumIdOldDocmentId] = mediumIdNewDocmentId;
  }
  return AlbumEntryEntity(
    name: map['name'],
    mediumId: mediumIdNewDocmentId,
  );
}