fromEntity static method

Future<ProductDisplayModel?> fromEntity(
  1. String documentID,
  2. ProductDisplayEntity? entity
)

Implementation

static Future<ProductDisplayModel?> fromEntity(
    String documentID, ProductDisplayEntity? entity) async {
  if (entity == null) return null;
  return ProductDisplayModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    description: entity.description,
    itemDetailBackground:
        await BackgroundModel.fromEntity(entity.itemDetailBackground),
    addToBasketText: entity.addToBasketText,
    buyAction: await ActionModel.fromEntity(entity.buyAction),
    background: await BackgroundModel.fromEntity(entity.background),
    conditions: await StorageConditionsModel.fromEntity(entity.conditions),
  );
}