fromEntity static method
Implementation
static Future<ShopFrontModel?> fromEntity(
String documentID, ShopFrontEntity? entity) async {
if (entity == null) return null;
return ShopFrontModel(
documentID: documentID,
appId: entity.appId ?? '',
title: entity.title,
description: entity.description,
size: entity.size,
cardElevation: entity.cardElevation,
cardAxisSpacing: entity.cardAxisSpacing,
itemCardBackground:
await BackgroundModel.fromEntity(entity.itemCardBackground),
addToCartColor: await RgbModel.fromEntity(entity.addToCartColor),
scrollDirection: toScrollDirection(entity.scrollDirection),
buyAction: await ActionModel.fromEntity(entity.buyAction),
openProductAction: await ActionModel.fromEntity(entity.openProductAction),
padding: await EdgeInsetsGeometryModel.fromEntity(entity.padding),
conditions: await StorageConditionsModel.fromEntity(entity.conditions),
);
}