toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? bodyComponentsListMap =
      bodyComponents != null
          ? bodyComponents!.map((item) => item.toDocument()).toList()
          : 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 (title != null) {
    theDocument["title"] = title;
  } else {
    theDocument["title"] = null;
  }
  if (appBarId != null) {
    theDocument["appBarId"] = appBarId;
  } else {
    theDocument["appBarId"] = null;
  }
  if (drawerId != null) {
    theDocument["drawerId"] = drawerId;
  } else {
    theDocument["drawerId"] = null;
  }
  if (endDrawerId != null) {
    theDocument["endDrawerId"] = endDrawerId;
  } else {
    theDocument["endDrawerId"] = null;
  }
  if (homeMenuId != null) {
    theDocument["homeMenuId"] = homeMenuId;
  } else {
    theDocument["homeMenuId"] = null;
  }
  if (bodyComponents != null) {
    theDocument["bodyComponents"] = bodyComponentsListMap;
  } else {
    theDocument["bodyComponents"] = null;
  }
  if (backgroundOverride != null) {
    theDocument["backgroundOverride"] = backgroundOverrideMap;
  } else {
    theDocument["backgroundOverride"] = null;
  }
  if (layout != null) {
    theDocument["layout"] = layout;
  } else {
    theDocument["layout"] = null;
  }
  if (gridViewId != null) {
    theDocument["gridViewId"] = gridViewId;
  } else {
    theDocument["gridViewId"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}