toJson method
Implementation
Map<String, dynamic> toJson() {
return {
if (id != null) 'id': id,
'type': type.fullName,
'bbox': bbox,
'createdAt': createdAt,
if (creatorName != null) 'creatorName': creatorName,
'pageIndex': pageIndex,
'opacity': opacity,
if (pdfObjectId != null) 'pdfObjectId': pdfObjectId,
if (flags != null && flags!.isNotEmpty)
'flags': flags!.map((f) => f.name).toList(),
if (updatedAt != null) 'updatedAt': updatedAt,
if (name != null) 'name': name,
if (subject != null) 'subject': subject,
if (customData != null) 'customData': customData,
'hidden': hidden,
'v': v,
};
}