isMedia property

bool get isMedia

Indicates whether this Attachment represents an image or a video.

Implementation

bool get isMedia {
  if (this is ImageAttachment) {
    return true;
  }

  if (this is FileAttachment) {
    return (this as FileAttachment).isVideo;
  }

  if (this is LocalAttachment) {
    final local = this as LocalAttachment;
    return local.file.isImage || local.file.isVideo;
  }

  return false;
}