RedactionAnnotation.fromJson constructor

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

Implementation

factory RedactionAnnotation.fromJson(Map<String, dynamic> json) {
  return RedactionAnnotation(
    id: json['id'] as String?,
    rects: (json['rects'] as List<dynamic>)
        .map((rect) => Annotation._toDoubleList(rect as List<dynamic>))
        .toList(),
    createdAt: json['createdAt'] as String?,
    creatorName: json['creatorName'] as String?,
    fillColor: Annotation._hexToColor(json['fillColor'] as String?),
    overlayText: json['overlayText'] as String?,
    fontSize: (json['fontSize'] as num?)?.toDouble(),
    fontColor: Annotation._hexToColor(json['fontColor'] as String?),
    repeat: json['repeat'] as String?,
    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,
    outlineColor: Annotation._hexToColor(json['outlineColor'] as String?),
    repeatOverlayText: json['repeatOverlayText'] as bool?,
    rotation: (json['rotation'] as num?)?.toDouble() ?? 0.0,
    customData: json['customData'] != null
        ? Map<String, dynamic>.from(json['customData'])
        : null,
  );
}