toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? itemImageBackgroundMap =
      itemImageBackground != null ? itemImageBackground!.toDocument() : null;
  final Map<String, dynamic>? itemDetailBackgroundMap =
      itemDetailBackground != null
          ? itemDetailBackground!.toDocument()
          : null;
  final Map<String, dynamic>? checkoutActionMap =
      checkoutAction != null ? checkoutAction!.toDocument() : null;
  final Map<String, dynamic>? backToShopActionMap =
      backToShopAction != null ? backToShopAction!.toDocument() : null;
  final Map<String, dynamic>? openProductActionMap =
      openProductAction != null ? openProductAction!.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 (checkoutText != null) {
    theDocument["checkoutText"] = checkoutText;
  } else {
    theDocument["checkoutText"] = null;
  }
  if (shopId != null) {
    theDocument["shopId"] = shopId;
  } else {
    theDocument["shopId"] = null;
  }
  if (itemImageBackground != null) {
    theDocument["itemImageBackground"] = itemImageBackgroundMap;
  } else {
    theDocument["itemImageBackground"] = null;
  }
  if (itemDetailBackground != null) {
    theDocument["itemDetailBackground"] = itemDetailBackgroundMap;
  } else {
    theDocument["itemDetailBackground"] = null;
  }
  if (checkoutAction != null) {
    theDocument["checkoutAction"] = checkoutActionMap;
  } else {
    theDocument["checkoutAction"] = null;
  }
  if (backToShopAction != null) {
    theDocument["backToShopAction"] = backToShopActionMap;
  } else {
    theDocument["backToShopAction"] = null;
  }
  if (openProductAction != null) {
    theDocument["openProductAction"] = openProductActionMap;
  } else {
    theDocument["openProductAction"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}