toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? itemDetailBackgroundMap =
      itemDetailBackground != null
          ? itemDetailBackground!.toDocument()
          : null;
  final Map<String, dynamic>? buyActionMap =
      buyAction != null ? buyAction!.toDocument() : null;
  final Map<String, dynamic>? backgroundMap =
      background != null ? background!.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 (description != null) {
    theDocument["description"] = description;
  } else {
    theDocument["description"] = null;
  }
  if (itemDetailBackground != null) {
    theDocument["itemDetailBackground"] = itemDetailBackgroundMap;
  } else {
    theDocument["itemDetailBackground"] = null;
  }
  if (addToBasketText != null) {
    theDocument["addToBasketText"] = addToBasketText;
  } else {
    theDocument["addToBasketText"] = null;
  }
  if (buyAction != null) {
    theDocument["buyAction"] = buyActionMap;
  } else {
    theDocument["buyAction"] = null;
  }
  if (shopId != null) {
    theDocument["shopId"] = shopId;
  } else {
    theDocument["shopId"] = null;
  }
  if (background != null) {
    theDocument["background"] = backgroundMap;
  } else {
    theDocument["background"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}