toMap method
Returns a map of properties. This method is used internally by the SDK.
Implementation
@override
Map<String, dynamic> toMap() {
Map<String, dynamic> map = _getProperties();
if (color != null) {
map['color'] = color?.toHex();
}
if (thickness > 0.0) {
map['thickness'] = thickness;
}
if (fillColor != null) {
map['fillColor'] = fillColor?.toHex();
}
if (alpha != null) {
map['alpha'] = alpha;
}
if (availableColors != null) {
map['availableColors'] = availableColors?.map((e) => e.toHex()).toList();
}
if (availableFillColors != null) {
map['availableFillColors'] =
availableFillColors?.map((e) => e.toHex()).toList();
}
if (minThickness != null) {
map['minThickness'] = minThickness;
}
if (maxThickness != null) {
map['maxThickness'] = maxThickness;
}
if (minAlpha != null) {
map['minAlpha'] = minAlpha;
}
if (maxAlpha != null) {
map['maxAlpha'] = maxAlpha;
}
if (enableColorPicker != null) {
map['enableColorPicker'] = enableColorPicker;
}
if (previewEnabled != null) {
map['previewEnabled'] = previewEnabled;
}
if (blendMode != null) {
map['blendMode'] = blendMode?.name;
}
return map;
}