toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? bodyComponentsCurrentMemberListMap =
      bodyComponentsCurrentMember != null
          ? bodyComponentsCurrentMember!
              .map((item) => item.toDocument())
              .toList()
          : null;
  final List<Map<String?, dynamic>>? bodyComponentsOtherMemberListMap =
      bodyComponentsOtherMember != null
          ? bodyComponentsOtherMember!
              .map((item) => item.toDocument())
              .toList()
          : null;
  final Map<String, dynamic>? itemColorMap =
      itemColor != null ? itemColor!.toDocument() : null;
  final Map<String, dynamic>? selectedItemColorMap =
      selectedItemColor != null ? selectedItemColor!.toDocument() : null;
  final Map<String, dynamic>? backgroundOverrideMap =
      backgroundOverride != null ? backgroundOverride!.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 (bodyComponentsCurrentMember != null) {
    theDocument["bodyComponentsCurrentMember"] =
        bodyComponentsCurrentMemberListMap;
  } else {
    theDocument["bodyComponentsCurrentMember"] = null;
  }
  if (bodyComponentsOtherMember != null) {
    theDocument["bodyComponentsOtherMember"] =
        bodyComponentsOtherMemberListMap;
  } else {
    theDocument["bodyComponentsOtherMember"] = null;
  }
  if (itemColor != null) {
    theDocument["itemColor"] = itemColorMap;
  } else {
    theDocument["itemColor"] = null;
  }
  if (selectedItemColor != null) {
    theDocument["selectedItemColor"] = selectedItemColorMap;
  } else {
    theDocument["selectedItemColor"] = null;
  }
  if (backgroundOverride != null) {
    theDocument["backgroundOverride"] = backgroundOverrideMap;
  } else {
    theDocument["backgroundOverride"] = null;
  }
  if (feedFrontId != null) {
    theDocument["feedFrontId"] = feedFrontId;
  } else {
    theDocument["feedFrontId"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}