fromMap static method

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

Implementation

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

  var tutorialEntriesFromMap = map['tutorialEntries'];
  List<TutorialEntryEntity> tutorialEntriesList;
  if (tutorialEntriesFromMap != null) {
    tutorialEntriesList = (map['tutorialEntries'] as List<dynamic>)
        .map((dynamic item) => TutorialEntryEntity.fromMap(item as Map,
            newDocumentIds: newDocumentIds)!)
        .toList();
  } else {
    tutorialEntriesList = [];
  }
  var conditionsFromMap = map['conditions'];
  if (conditionsFromMap != null) {
    conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
        newDocumentIds: newDocumentIds);
  }

  return TutorialEntity(
    appId: map['appId'],
    name: map['name'],
    title: map['title'],
    description: map['description'],
    tutorialEntries: tutorialEntriesList,
    conditions: conditionsFromMap,
  );
}