fromMap static method
Implementation
static BookletEntity? fromMap(Object? o,
{Map<String, String>? newDocumentIds}) {
if (o == null) return null;
var map = o as Map<String, dynamic>;
var sectionsFromMap = map['sections'];
List<SectionEntity> sectionsList;
if (sectionsFromMap != null) {
sectionsList = (map['sections'] as List<dynamic>)
.map((dynamic item) => SectionEntity.fromMap(item as Map,
newDocumentIds: newDocumentIds)!)
.toList();
} else {
sectionsList = [];
}
var conditionsFromMap = map['conditions'];
if (conditionsFromMap != null) {
conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
newDocumentIds: newDocumentIds);
}
return BookletEntity(
appId: map['appId'],
description: map['description'],
sections: sectionsList,
conditions: conditionsFromMap,
);
}