toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    "barcodeUuid": barcodeUuid,
    if (text != null) "text": text,
    if (textFormat != null) "textFormat": textFormat!.name,
    if (polygonColor != null) "polygonColor": toColorString(polygonColor!),
    if (strokeColor != null) "strokeColor": toColorString(strokeColor!),
    if (highlightedPolygonColor != null)
      "highlightedPolygonColor": toColorString(highlightedPolygonColor!),
    if (highlightedStrokeColor != null)
      "highlightedStrokeColor": toColorString(highlightedStrokeColor!),
    if (textColor != null) "textColor": toColorString(textColor!),
    if (textContainerColor != null)
      "textContainerColor": toColorString(textContainerColor!),
    if (highlightedTextColor != null)
      "highlightedTextColor": toColorString(highlightedTextColor!),
    if (highlightedTextContainerColor != null)
      "highlightedTextContainerColor":
          toColorString(highlightedTextContainerColor!),
  };
}