attachment property

AttachmentModel get attachment

Attachment.

Implementation

AttachmentModel get attachment {
  final attachmentPayload = update.object;

  if (isPhoto) {
    return PhotoAttachmentModel(attachmentPayload);
  }

  if (isVideo) {
    return VideoAttachmentModel(attachmentPayload);
  }

  if (isAudio) {
    return AudioAttachmentModel(attachmentPayload);
  }

  throw VkDartException('type ${update.type} is not supported.');
}