toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? backgroundOverrideMap =
      backgroundOverride != null ? backgroundOverride!.toDocument() : null;
  final Map<String, dynamic>? popupMenuBackgroundColorMap =
      popupMenuBackgroundColor != null
          ? popupMenuBackgroundColor!.toDocument()
          : null;
  final Map<String, dynamic>? headerBackgroundOverrideMap =
      headerBackgroundOverride != null
          ? headerBackgroundOverride!.toDocument()
          : null;
  final Map<String, dynamic>? popupMenuBackgroundColorOverrideMap =
      popupMenuBackgroundColorOverride != null
          ? popupMenuBackgroundColorOverride!.toDocument()
          : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (name != null) {
    theDocument["name"] = name;
  } else {
    theDocument["name"] = null;
  }
  if (backgroundOverride != null) {
    theDocument["backgroundOverride"] = backgroundOverrideMap;
  } else {
    theDocument["backgroundOverride"] = null;
  }
  if (headerText != null) {
    theDocument["headerText"] = headerText;
  } else {
    theDocument["headerText"] = null;
  }
  if (secondHeaderText != null) {
    theDocument["secondHeaderText"] = secondHeaderText;
  } else {
    theDocument["secondHeaderText"] = null;
  }
  if (headerHeight != null) {
    theDocument["headerHeight"] = headerHeight;
  } else {
    theDocument["headerHeight"] = null;
  }
  if (popupMenuBackgroundColor != null) {
    theDocument["popupMenuBackgroundColor"] = popupMenuBackgroundColorMap;
  } else {
    theDocument["popupMenuBackgroundColor"] = null;
  }
  if (headerBackgroundOverride != null) {
    theDocument["headerBackgroundOverride"] = headerBackgroundOverrideMap;
  } else {
    theDocument["headerBackgroundOverride"] = null;
  }
  if (popupMenuBackgroundColorOverride != null) {
    theDocument["popupMenuBackgroundColorOverride"] =
        popupMenuBackgroundColorOverrideMap;
  } else {
    theDocument["popupMenuBackgroundColorOverride"] = null;
  }
  if (menuId != null) {
    theDocument["menuId"] = menuId;
  } else {
    theDocument["menuId"] = null;
  }
  return theDocument;
}