toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  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 (authorId != null) {
    theDocument["authorId"] = authorId;
  } else {
    theDocument["authorId"] = null;
  }
  if (base != null) {
    theDocument["base"] = base;
  } else {
    theDocument["base"] = null;
  }
  if (ext != null) {
    theDocument["ext"] = ext;
  } else {
    theDocument["ext"] = null;
  }
  if (url != null) {
    theDocument["url"] = url;
  } else {
    theDocument["url"] = null;
  }
  if (ref != null) {
    theDocument["ref"] = ref;
  } else {
    theDocument["ref"] = null;
  }
  if (urlThumbnail != null) {
    theDocument["urlThumbnail"] = urlThumbnail;
  } else {
    theDocument["urlThumbnail"] = null;
  }
  if (refThumbnail != null) {
    theDocument["refThumbnail"] = refThumbnail;
  } else {
    theDocument["refThumbnail"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  if (mediumType != null) {
    theDocument["mediumType"] = mediumType;
  } else {
    theDocument["mediumType"] = null;
  }
  if (mediumWidth != null) {
    theDocument["mediumWidth"] = mediumWidth;
  } else {
    theDocument["mediumWidth"] = null;
  }
  if (mediumHeight != null) {
    theDocument["mediumHeight"] = mediumHeight;
  } else {
    theDocument["mediumHeight"] = null;
  }
  if (thumbnailWidth != null) {
    theDocument["thumbnailWidth"] = thumbnailWidth;
  } else {
    theDocument["thumbnailWidth"] = null;
  }
  if (thumbnailHeight != null) {
    theDocument["thumbnailHeight"] = thumbnailHeight;
  } else {
    theDocument["thumbnailHeight"] = null;
  }
  if (relatedMediumId != null) {
    theDocument["relatedMediumId"] = relatedMediumId;
  } else {
    theDocument["relatedMediumId"] = null;
  }
  return theDocument;
}