toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    // fundamentals & general purpose
    "workspaceKey": workspaceKey,
    if (event != null) "event": event,
    if (events != null) "events": events,
    if (mode != null) "mode": mode,
    if (extraConfig != null) "extraConfig": extraConfig,
    // pricing
    if (pricing != null) "pricing": pricing!.map((p) => p.toJson()).toList(),
    if (showSectionPricingOverlay != null) "showSectionPricingOverlay": showSectionPricingOverlay,
    // selection
    if (selectedObjects != null) "selectedObjects": selectedObjects,
    if (selectableObjects != null) "selectableObjects": selectableObjects,
    if (selectionValidators != null) "selectionValidators": selectionValidators!.map((v) => v.toJson()).toList(),
    if (maxSelectedObjects != null) "maxSelectedObjects": maxSelectedObjects!.toJson(),
    if (numberOfPlacesToSelect != null) "numberOfPlacesToSelect": numberOfPlacesToSelect,
    if (multiSelectEnabled != null) "multiSelectEnabled": multiSelectEnabled,
    if (objectsWithoutPricingSelectable != null) "objectsWithoutPricingSelectable": objectsWithoutPricingSelectable,
    // popovers and tooltips
    if (objectPopover != null) "objectPopover": objectPopover!.toJson(),
    if (showActiveSectionTooltipOnMobile != null)
      "showActiveSectionTooltipOnMobile": showActiveSectionTooltipOnMobile,
    // language and text
    if (language != null) "language": language,
    if (messages.isNotEmpty) "messages": messages,
    // categories
    if (categoryFilter != null) "categoryFilter": categoryFilter!.toJson(),
    if (availableCategories != null) "availableCategories": availableCategories,
    if (unavailableCategories != null) "unavailableCategories": unavailableCategories,
    if (filteredCategories != null) "filteredCategories": filteredCategories,
    // channels
    if (channels != null) "channels": channels,
    // object overrides
    if (objectColor != null) "objectColor": objectColor,
    if (sectionColor != null) "sectionColor": sectionColor,
    if (objectLabel != null) "objectLabel": objectLabel,
    if (objectIcon != null) "objectIcon": objectIcon,
    // visibility
    if (showSectionContents != null) "showSectionContents": showSectionContents!.toJson(),
    if (hideSectionsNotForSale != null) "hideSectionsNotForSale": hideSectionsNotForSale,
    if (isObjectVisible != null) "isObjectVisible": isObjectVisible,
    if (showSeatLabels != null) "showSeatLabels": showSeatLabels,
    // session
    if (session != null) "session": session!.toJson(),
    if (holdToken != null) "holdToken": holdToken,
    if (holdOnSelectForGAs != null) "holdOnSelectForGAs": holdOnSelectForGAs,
    // UI customization
    if (showMinimap != null) "showMinimap": showMinimap,
    if (showLegend != null) "showLegend": showLegend,
    if (legendConfig != null) "legendConfig": legendConfig!.toJson(),
    if (showZoomOutButtonOnMobile != null) "showZoomOutButtonOnMobile": showZoomOutButtonOnMobile,
    if (loading != null) "loading": loading,
    // styling
    if (colorScheme != null) "colorScheme": colorScheme!.toJson(),
    if (colors != null) "colors": colors!.toJson(),
    // floors
    if (activeFloor != null) "activeFloor": activeFloor,
    if (lockActiveFloor != null) "lockActiveFloor": lockActiveFloor,
    if (showFloorElevator != null) "showFloorElevator": showFloorElevator,
    // advanced
    if (unifiedObjectPropertiesInCallbacks != null) "unifiedObjectPropertiesInCallbacks": unifiedObjectPropertiesInCallbacks,
  };
}