toDocument method
Implementation
@override
Map<String, Object?> toDocument() {
final Map<String, dynamic>? colorMap =
color != null ? color!.toDocument() : null;
Map<String, Object?> theDocument = HashMap();
if (color != null) {
theDocument["color"] = colorMap;
} else {
theDocument["color"] = null;
}
if (stop != null) {
theDocument["stop"] = stop;
} else {
theDocument["stop"] = null;
}
return theDocument;
}