FileAttachment class final

Represents a file attachment in a chat message.

This class extends Attachment and provides specific properties and methods for handling file attachments.

Inheritance
Implementers
Annotations

Constructors

FileAttachment({required String name, required String mimeType, required Uint8List bytes})
Creates a FileAttachment with the given name, MIME type, and bytes.
const
FileAttachment.fileOrImage({required String name, required String mimeType, required Uint8List bytes})
Factory constructor for creating either a FileAttachment or an ImageFileAttachment.
factory

Properties

bytes Uint8List
The binary content of the file attachment.
final
hashCode int
The hash code for this object.
no setterinherited
isImage bool
Whether this attachment holds displayable image content.
no setterinherited
mimeType String
The MIME type of the file attachment.
final
name String
The name of the attachment.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromFile(XFile file) Future<FileAttachment>
Creates a FileAttachment from an XFile.