fromMap static method

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

Implementation

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

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

  return ProfileEntity(
    appId: map['appId'],
    description: map['description'],
    feedId: map['feedId'],
    backgroundOverride: backgroundOverrideFromMap,
    conditions: conditionsFromMap,
  );
}