toJson method

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

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    ...super.toJson(),
    'text': text,
    'opacity': opacity,
    'rotation': rotation,
    if (fontFamily != null) 'fontFamily': fontFamily,
    if (fontSize != null) 'fontSize': fontSize,
    if (color != null) 'color': Annotation._colorToHex(color!),
  };
}