fromMap static method
Implementation
static AlbumEntity? fromMap(Object? o,
{Map<String, String>? newDocumentIds}) {
if (o == null) return null;
var map = o as Map<String, dynamic>;
var albumEntriesFromMap = map['albumEntries'];
List<AlbumEntryEntity> albumEntriesList;
if (albumEntriesFromMap != null) {
albumEntriesList = (map['albumEntries'] as List<dynamic>)
.map((dynamic item) => AlbumEntryEntity.fromMap(item as Map,
newDocumentIds: newDocumentIds)!)
.toList();
} else {
albumEntriesList = [];
}
var backgroundImageFromMap = map['backgroundImage'];
if (backgroundImageFromMap != null) {
backgroundImageFromMap = BackgroundEntity.fromMap(backgroundImageFromMap,
newDocumentIds: newDocumentIds);
}
var conditionsFromMap = map['conditions'];
if (conditionsFromMap != null) {
conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
newDocumentIds: newDocumentIds);
}
return AlbumEntity(
appId: map['appId'],
albumEntries: albumEntriesList,
description: map['description'],
backgroundImage: backgroundImageFromMap,
conditions: conditionsFromMap,
);
}