Attachment class

The class that contains the information about an attachment

Annotations
  • @JsonSerializable(includeIfNull: false)

Constructors

Attachment({String? id, String? type, String? titleLink, String? title, String? thumbUrl, String? text, String? pretext, String? ogScrapeUrl, String? imageUrl, String? footerIcon, String? footer, dynamic fields, String? fallback, String? color, String? authorName, String? authorLink, String? authorIcon, String? assetUrl, List<Action>? actions, Map<String, Object?> extraData = const {}, AttachmentFile? file, UploadState? uploadState})
Constructor used for json serialization
Attachment.fromData(Map<String, dynamic> json)
Create a new instance from a db data
factory
Attachment.fromJson(Map<String, dynamic> json)
Create a new instance from a json
factory

Properties

actions List<Action>
Actions from a command
final
assetUrl String?
The URL to the audio, video or image related to the URL.
final
authorIcon String?
final
final
authorName String?
The name of the author.
final
color String?
final
extraData Map<String, Object?>
Map of custom channel extraData
final
fallback String?
final
fields → dynamic
final
file AttachmentFile?
The file present inside this attachment.
final
fileSize int?
Shortcut for file size.
no setter
final
footerIcon String?
final
hashCode int
The hash code for this object.
no setterinherited
id String
The attachment ID.
final
imageUrl String?
The URL to the attached image. This is present for URL pointing to an image article (eg. Unsplash)
final
localUri Uri?
final
mimeType String?
Shortcut for file mimeType.
no setter
ogScrapeUrl String?
The original URL that was used to scrape this attachment.
final
pretext String?
Optional text that appears above the attachment block
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
text String?
The attachment text. It will be displayed in the channel next to the original message.
final
thumbUrl String?
The URL to the attached file thumbnail. You can use this to represent the attached link.
final
title String?
The attachment title
final
The link to which the attachment message points to.
final
type String?
The attachment type based on the URL resource. This can be: audio, image or video
final
uploadState UploadState
The current upload state of the attachment
latefinal

Methods

copyWith({String? id, String? type, String? titleLink, String? title, String? thumbUrl, String? text, String? pretext, String? ogScrapeUrl, String? imageUrl, String? footerIcon, String? footer, dynamic fields, String? fallback, String? color, String? authorName, String? authorLink, String? authorIcon, String? assetUrl, List<Action>? actions, AttachmentFile? file, UploadState? uploadState, Map<String, Object?>? extraData}) Attachment
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toData() Map<String, dynamic>
Serialize to db data
toJson() Map<String, dynamic>
Serialize to json
toString() String
A string representation of this object.
inherited

Operators

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

Constants

dbSpecificTopLevelFields → const List<String>
Known db specific top level fields. Useful for Serializer methods.
topLevelFields → const List<String>
Known top level fields. Useful for Serializer methods.