toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? backgroundOverridePostsMap =
      backgroundOverridePosts != null
          ? backgroundOverridePosts!.toDocument()
          : null;
  final Map<String, dynamic>? backgroundOverrideProfileMap =
      backgroundOverrideProfile != null
          ? backgroundOverrideProfile!.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 (feedId != null) {
    theDocument["feedId"] = feedId;
  } else {
    theDocument["feedId"] = null;
  }
  if (backgroundOverridePosts != null) {
    theDocument["backgroundOverridePosts"] = backgroundOverridePostsMap;
  } else {
    theDocument["backgroundOverridePosts"] = null;
  }
  if (backgroundOverrideProfile != null) {
    theDocument["backgroundOverrideProfile"] = backgroundOverrideProfileMap;
  } else {
    theDocument["backgroundOverrideProfile"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}