Attachment.fromOGAttachment constructor

Attachment.fromOGAttachment(
  1. OGAttachmentResponse ogAttachment
)

Implementation

factory Attachment.fromOGAttachment(OGAttachmentResponse ogAttachment) =>
    Attachment(
      // If the type is not specified, we default to urlPreview.
      type: ogAttachment.type ?? AttachmentType.urlPreview,
      title: ogAttachment.title,
      titleLink: ogAttachment.titleLink,
      text: ogAttachment.text,
      imageUrl: ogAttachment.imageUrl,
      thumbUrl: ogAttachment.thumbUrl,
      authorName: ogAttachment.authorName,
      authorLink: ogAttachment.authorLink,
      assetUrl: ogAttachment.assetUrl,
      ogScrapeUrl: ogAttachment.ogScrapeUrl,
      uploadState: const UploadState.success(),
    );