toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? memberMediaListMap = memberMedia != null
      ? memberMedia!.map((item) => item.toDocument()).toList()
      : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (feedId != null) {
    theDocument["feedId"] = feedId;
  } else {
    theDocument["feedId"] = null;
  }
  if (authorId != null) {
    theDocument["authorId"] = authorId;
  } else {
    theDocument["authorId"] = null;
  }
  if (profile != null) {
    theDocument["profile"] = profile;
  } else {
    theDocument["profile"] = null;
  }
  if (profileBackgroundId != null) {
    theDocument["profileBackgroundId"] = profileBackgroundId;
  } else {
    theDocument["profileBackgroundId"] = null;
  }
  if (profileOverride != null) {
    theDocument["profileOverride"] = profileOverride;
  } else {
    theDocument["profileOverride"] = null;
  }
  if (nameOverride != null) {
    theDocument["nameOverride"] = nameOverride;
  } else {
    theDocument["nameOverride"] = null;
  }
  if (accessibleByGroup != null) {
    theDocument["accessibleByGroup"] = accessibleByGroup;
  } else {
    theDocument["accessibleByGroup"] = null;
  }
  if (accessibleByMembers != null) {
    theDocument["accessibleByMembers"] = accessibleByMembers!.toList();
  } else {
    theDocument["accessibleByMembers"] = null;
  }
  if (readAccess != null) {
    theDocument["readAccess"] = readAccess!.toList();
  } else {
    theDocument["readAccess"] = null;
  }
  if (memberMedia != null) {
    theDocument["memberMedia"] = memberMediaListMap;
  } else {
    theDocument["memberMedia"] = null;
  }
  return theDocument;
}