AnnotationStroke.fromJson constructor

AnnotationStroke.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory AnnotationStroke.fromJson(Map<String, dynamic> json) {
  return AnnotationStroke(
    id: json['id'] as String,
    fromIdentity: json['fromIdentity'] as String? ?? '',
    tool: json['tool'] as String,
    color: json['color'] as String,
    width: (json['width'] as num).toDouble(),
    points: (json['points'] as List)
        .map((p) => (p as List).map((v) => (v as num).toDouble()).toList())
        .toList(),
  );
}