toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    ...super.toJson(),
    'lines': lines.toJson(),
    'lineWidth': lineWidth,
    'isDrawnNaturally': isDrawnNaturally,
    if (isSignature != null) 'isSignature': isSignature,
    if (strokeColor != null)
      'strokeColor': Annotation._colorToHex(strokeColor!),
    if (backgroundColor != null)
      'backgroundColor': Annotation._colorToHex(backgroundColor!),
    if (blendMode != null) 'blendMode': blendMode!.name,
    if (note != null) 'note': note,
  };
}