fromMap static method

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

Implementation

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

  var backgroundFromMap = map['background'];
  if (backgroundFromMap != null) {
    backgroundFromMap = BackgroundEntity.fromMap(backgroundFromMap,
        newDocumentIds: newDocumentIds);
  }
  var conditionsFromMap = map['conditions'];
  if (conditionsFromMap != null) {
    conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
        newDocumentIds: newDocumentIds);
  }

  return DynamicWidgetEntity(
    appId: map['appId'],
    description: map['description'],
    content: map['content'],
    background: backgroundFromMap,
    conditions: conditionsFromMap,
  );
}