toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
'id': id,
'type': type.index,
'startPoint': startPoint != null
? {'x': startPoint!.dx, 'y': startPoint!.dy}
: null,
'directionPoint': directionPoint != null
? {'x': directionPoint!.dx, 'y': directionPoint!.dy}
: null,
'color': color.value,
'strokeWidth': strokeWidth,
'createTime': createTime.millisecondsSinceEpoch,
};
}