toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? itemCardBackgroundMap =
      itemCardBackground != null ? itemCardBackground!.toDocument() : null;
  final Map<String, dynamic>? addToCartColorMap =
      addToCartColor != null ? addToCartColor!.toDocument() : null;
  final Map<String, dynamic>? buyActionMap =
      buyAction != null ? buyAction!.toDocument() : null;
  final Map<String, dynamic>? openProductActionMap =
      openProductAction != null ? openProductAction!.toDocument() : null;
  final Map<String, dynamic>? paddingMap =
      padding != null ? padding!.toDocument() : null;
  final Map<String, dynamic>? conditionsMap =
      conditions != null ? conditions!.toDocument() : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (title != null) {
    theDocument["title"] = title;
  } else {
    theDocument["title"] = null;
  }
  if (description != null) {
    theDocument["description"] = description;
  } else {
    theDocument["description"] = null;
  }
  if (shopId != null) {
    theDocument["shopId"] = shopId;
  } else {
    theDocument["shopId"] = null;
  }
  if (size != null) {
    theDocument["size"] = size;
  } else {
    theDocument["size"] = null;
  }
  if (cardElevation != null) {
    theDocument["cardElevation"] = cardElevation;
  } else {
    theDocument["cardElevation"] = null;
  }
  if (cardAxisSpacing != null) {
    theDocument["cardAxisSpacing"] = cardAxisSpacing;
  } else {
    theDocument["cardAxisSpacing"] = null;
  }
  if (itemCardBackground != null) {
    theDocument["itemCardBackground"] = itemCardBackgroundMap;
  } else {
    theDocument["itemCardBackground"] = null;
  }
  if (addToCartColor != null) {
    theDocument["addToCartColor"] = addToCartColorMap;
  } else {
    theDocument["addToCartColor"] = null;
  }
  if (scrollDirection != null) {
    theDocument["scrollDirection"] = scrollDirection;
  } else {
    theDocument["scrollDirection"] = null;
  }
  if (buyAction != null) {
    theDocument["buyAction"] = buyActionMap;
  } else {
    theDocument["buyAction"] = null;
  }
  if (openProductAction != null) {
    theDocument["openProductAction"] = openProductActionMap;
  } else {
    theDocument["openProductAction"] = null;
  }
  if (padding != null) {
    theDocument["padding"] = paddingMap;
  } else {
    theDocument["padding"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}