SoundAnnotation.fromJson constructor

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

Implementation

factory SoundAnnotation.fromJson(Map<String, dynamic> json) {
  return SoundAnnotation(
    id: json['id'] as String?,
    bbox: Annotation._toDoubleList(json['bbox'] as List),
    createdAt: json['createdAt'] as String?,
    creatorName: json['creatorName'] as String?,
    soundUrl: json['soundUrl'] as String? ?? '',
    icon: json['icon'] as String?,
    name: json['name'] 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?,
    subject: json['subject'] as String?,
    hidden: json['hidden'] as bool? ?? false,
    customData: json['customData'] != null
        ? Map<String, dynamic>.from(json['customData'])
        : null,
  );
}