Attachment class final Attachments attachments

Represents an attachment with metadata and state information.

Properties:

  • id: Unique identifier for the attachment.
  • timestamp: Timestamp of the last record update.
  • filename: Name of the attachment file, e.g., [id].jpg.
  • state: Current state of the attachment, represented as an ordinal of AttachmentState.
  • localUri: Local URI pointing to the attachment file, if available.
  • mediaType: Media type of the attachment, typically represented as a MIME type.
  • size: Size of the attachment in bytes, if available.
  • hasSynced: Indicates whether the attachment has been synced locally before.
  • metaData: Additional metadata associated with the attachment.
Annotations
  • @experimental

Constructors

Attachment({required String id, int timestamp = 0, required String filename, AttachmentState state = AttachmentState.queuedDownload, String? localUri, String? mediaType, int? size, bool hasSynced = false, String? metaData})
Creates an Attachment instance.
const
Attachment.fromRow(Row row)
Creates an Attachment instance from a database row.
factory

Properties

filename → String
Name of the attachment file, e.g., [id].jpg.
final
hashCode → int
The hash code for this object.
no setterinherited
hasSynced → bool
Indicates whether the attachment has been synced locally before.
final
id → String
Unique identifier for the attachment.
final
localUri → String?
Local URI pointing to the attachment file, if available.
final
mediaType → String?
Media type of the attachment, typically represented as a MIME type.
final
metaData → String?
Additional metadata associated with the attachment.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int?
Size of the attachment in bytes, if available.
final
state → AttachmentState
Current state of the attachment, represented as an ordinal of AttachmentState.
final
timestamp → int
Timestamp of the last record update.
final

Methods

copyWith({String? id, int? timestamp, String? filename, AttachmentState? state, String? localUri, String? mediaType, int? size, bool? hasSynced, String? metaData}) → Attachment
Returns a copy of this attachment with the given fields replaced.
markAsUnavailableLocally(AttachmentState newState) → Attachment
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