fromEntity static method

Future<CartModel?> fromEntity(
  1. String documentID,
  2. CartEntity? entity
)

Implementation

static Future<CartModel?> fromEntity(
    String documentID, CartEntity? entity) async {
  if (entity == null) return null;
  return CartModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    title: entity.title,
    description: entity.description,
    checkoutText: entity.checkoutText,
    itemImageBackground:
        await BackgroundModel.fromEntity(entity.itemImageBackground),
    itemDetailBackground:
        await BackgroundModel.fromEntity(entity.itemDetailBackground),
    checkoutAction: await ActionModel.fromEntity(entity.checkoutAction),
    backToShopAction: await ActionModel.fromEntity(entity.backToShopAction),
    openProductAction: await ActionModel.fromEntity(entity.openProductAction),
    conditions: await StorageConditionsModel.fromEntity(entity.conditions),
  );
}