createAttachmentFromJson method

AnnotationAttachment? createAttachmentFromJson(
  1. String attachmentId,
  2. Map<String, dynamic>? attachments
)

Creates an attachment from JSON data

Implementation

AnnotationAttachment? createAttachmentFromJson(
    String attachmentId, Map<String, dynamic>? attachments) {
  if (attachments == null || !attachments.containsKey(attachmentId)) {
    return null;
  }

  return AnnotationAttachment.fromJson(
    attachmentId,
    attachments[attachmentId],
  );
}