WidgetAnnotation.fromJson constructor
WidgetAnnotation.fromJson(
- Map<String, dynamic> json
)
Implementation
factory WidgetAnnotation.fromJson(Map<String, dynamic> json) {
return WidgetAnnotation(
id: json['id'] as String?,
bbox: Annotation._toDoubleList(json['bbox'] as List),
createdAt: json['createdAt'] as String?,
creatorName: json['creatorName'] as String?,
fieldType: (json['fieldType'] as String?) ?? '',
fieldName: json['fieldName'] as String?,
value: json['value'],
options: (json['options'] as List?)?.map((e) => e as String).toList(),
readOnly: json['readOnly'] as bool?,
required: json['required'] as bool?,
multiline: json['multiline'] as bool?,
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,
);
}