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