ImageMessage class final
One to many images, shown as a grid, with an optional caption.
Tapping an image opens a full-screen viewer with zoom. Set uploadProgress while your app uploads the images, and isSpoiler to blur them until the user taps.
- Inheritance
-
- Object
- ChatMessage
- ImageMessage
Constructors
-
ImageMessage({required String id, required ChatUser author, required DateTime createdAt, MessageStatus? status, String? replyToId, List<
ChatReaction> reactions = const [], ChatThreadSummary? thread, List<ChatReadReceipt> receipts = const [], String? forwardedFrom, DateTime? expiresAt, DateTime? deletedAt, DateTime? scheduledFor, Map<String, Object?> ? metadata, required List<ChatImage> images, String? caption, double? uploadProgress, bool isSpoiler = false}) -
Creates an image message.
const
Properties
-
The user who wrote the message.
finalinherited
- caption → String?
-
Optional text under the images. Supports markdown.
final
- createdAt → DateTime
-
When the message was created. Messages are ordered by this value.
finalinherited
- deletedAt → DateTime?
-
When the message was deleted for everyone. The bubble shows a
"message deleted" placeholder instead of the content.
finalinherited
- expiresAt → DateTime?
-
When the message disappears. The bubble shows the time left and the
controller removes the message when it expires.
finalinherited
- forwardedFrom → String?
-
Name of the original author when the message was forwarded. Shows a
"Forwarded" label.
finalinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Unique identifier of the message inside its conversation.
finalinherited
-
images
→ List<
ChatImage> -
The images. The grid shows up to four and a "+N" counter for the rest.
final
- isSpoiler → bool
-
Whether the images stay blurred until the user taps them.
final
-
metadata
→ Map<
String, Object?> ? -
Arbitrary data you want to carry with the message. Never read by chatx.
finalinherited
-
reactions
→ List<
ChatReaction> -
Emoji reactions, in the order they were first added.
finalinherited
-
receipts
→ List<
ChatReadReceipt> -
Who read the message and when. Shown as "Seen by" avatars in group
chats and in the message info sheet.
finalinherited
- replyToId → String?
-
ID of the message this one replies to. The bubble shows a quote of it.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheduledFor → DateTime?
-
When a scheduled message will be sent. The bubble is dimmed and shows
the scheduled time instead of the delivery status.
finalinherited
- status → MessageStatus?
-
Delivery state. Usually only set for messages of the current user.
finalinherited
- thread → ChatThreadSummary?
-
Summary of the thread started from this message. The bubble shows the
reply count and
ChatView.onThreadTapopens it.finalinherited - uploadProgress → double?
-
Upload progress from 0 to 1, or
nullwhen there is no upload.final
Methods
-
copyWith(
{String? id, ChatUser? author, DateTime? createdAt, MessageStatus? status, String? replyToId, List< ChatReaction> ? reactions, ChatThreadSummary? thread, List<ChatReadReceipt> ? receipts, String? forwardedFrom, DateTime? expiresAt, DateTime? deletedAt, DateTime? scheduledFor, Map<String, Object?> ? metadata, List<ChatImage> ? images, String? caption, double? uploadProgress, bool? isSpoiler, bool clearStatus = false, bool clearThread = false, bool clearExpiresAt = false, bool clearDeletedAt = false, bool clearScheduledFor = false, bool clearUploadProgress = false}) → ImageMessage - Returns a copy of this message with the given fields replaced.
-
copyWithMeta(
{MessageStatus? status, String? replyToId, List< ChatReaction> ? reactions, ChatThreadSummary? thread, List<ChatReadReceipt> ? receipts, String? forwardedFrom, DateTime? expiresAt, DateTime? deletedAt, DateTime? scheduledFor, Map<String, Object?> ? metadata, bool clearStatus = false, bool clearThread = false, bool clearExpiresAt = false, bool clearDeletedAt = false, bool clearScheduledFor = false}) → ImageMessage -
Returns a copy with any of the shared fields replaced. Pass
trueto aclear*flag to set that field tonull.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
withReactions(
List< ChatReaction> reactions) → ChatMessage -
Returns a copy of this message with
reactionsreplaced.inherited -
withStatus(
MessageStatus? status) → ChatMessage -
Returns a copy of this message with
statusreplaced.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override