toDocument method
Implementation
@override
Map<String, Object?> toDocument() {
final List<Map<String?, dynamic>>? subscriptionsListMap =
subscriptions != null
? subscriptions!.map((item) => item.toDocument()).toList()
: null;
Map<String, Object?> theDocument = HashMap();
if (name != null) {
theDocument["name"] = name;
} else {
theDocument["name"] = null;
}
if (subscriptions != null) {
theDocument["subscriptions"] = subscriptionsListMap;
} else {
theDocument["subscriptions"] = null;
}
if (subscriptionsAsStrArr != null) {
theDocument["subscriptionsAsStrArr"] = subscriptionsAsStrArr!.toList();
} else {
theDocument["subscriptionsAsStrArr"] = null;
}
if (photoId != null) {
theDocument["photoId"] = photoId;
} else {
theDocument["photoId"] = null;
}
if (photoURL != null) {
theDocument["photoURL"] = photoURL;
} else {
theDocument["photoURL"] = null;
}
if (shipStreet1 != null) {
theDocument["shipStreet1"] = shipStreet1;
} else {
theDocument["shipStreet1"] = null;
}
if (shipStreet2 != null) {
theDocument["shipStreet2"] = shipStreet2;
} else {
theDocument["shipStreet2"] = null;
}
if (shipCity != null) {
theDocument["shipCity"] = shipCity;
} else {
theDocument["shipCity"] = null;
}
if (shipState != null) {
theDocument["shipState"] = shipState;
} else {
theDocument["shipState"] = null;
}
if (postcode != null) {
theDocument["postcode"] = postcode;
} else {
theDocument["postcode"] = null;
}
if (country != null) {
theDocument["country"] = country;
} else {
theDocument["country"] = null;
}
if (invoiceSame != null) {
theDocument["invoiceSame"] = invoiceSame;
} else {
theDocument["invoiceSame"] = null;
}
if (invoiceStreet1 != null) {
theDocument["invoiceStreet1"] = invoiceStreet1;
} else {
theDocument["invoiceStreet1"] = null;
}
if (invoiceStreet2 != null) {
theDocument["invoiceStreet2"] = invoiceStreet2;
} else {
theDocument["invoiceStreet2"] = null;
}
if (invoiceCity != null) {
theDocument["invoiceCity"] = invoiceCity;
} else {
theDocument["invoiceCity"] = null;
}
if (invoiceState != null) {
theDocument["invoiceState"] = invoiceState;
} else {
theDocument["invoiceState"] = null;
}
if (invoicePostcode != null) {
theDocument["invoicePostcode"] = invoicePostcode;
} else {
theDocument["invoicePostcode"] = null;
}
if (invoiceCountry != null) {
theDocument["invoiceCountry"] = invoiceCountry;
} else {
theDocument["invoiceCountry"] = null;
}
if (email != null) {
theDocument["email"] = email;
} else {
theDocument["email"] = null;
}
if (isAnonymous != null) {
theDocument["isAnonymous"] = isAnonymous;
} else {
theDocument["isAnonymous"] = null;
}
return theDocument;
}