HighlightAnnotation.fromJson constructor

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

Implementation

factory HighlightAnnotation.fromJson(Map<String, dynamic> json) {
  return HighlightAnnotation(
      id: json['id'] as String?,
      bbox: Annotation._toDoubleList(json['bbox'] as List),
      createdAt: json['createdAt'] as String?,
      creatorName: json['creatorName'] as String?,
      color: Annotation._hexToColor(json['color'] as String?),
      rects: (json['rects'] as List)
          .map((line) => Annotation._toDoubleList(line as List))
          .toList(),
      pageIndex: json['pageIndex'] as int,
      opacity: json['opacity'] != null
          ? Annotation._toDouble(json['opacity'])
          : 1.0,
      pdfObjectId: json['pdfObjectId'] as int?,
      flags: Annotation._stringsToFlags(json['flags'] as List<dynamic>?),
      updatedAt: json['updatedAt'] as String?,
      name: json['name'] as String?,
      subject: json['subject'] as String?,
      hidden: json['hidden'] as bool? ?? false,
      customData: json['customData'] != null
          ? Map<String, dynamic>.from(json['customData'])
          : null);
}