ProductMessage class final
One product card, or a carousel when there are several products.
- Inheritance
-
- Object
- ChatMessage
- ProductMessage
Constructors
-
ProductMessage({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<ChatProduct> products, String? text}) -
Creates a product message.
const
Properties
-
The user who wrote the message.
finalinherited
- 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
-
metadata
→ Map<
String, Object?> ? -
Arbitrary data you want to carry with the message. Never read by chatx.
finalinherited
-
products
→ List<
ChatProduct> -
The products. More than one shows a horizontal carousel.
final
-
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
- text → String?
-
Optional text above the products. Supports markdown.
final
- thread → ChatThreadSummary?
-
Summary of the thread started from this message. The bubble shows the
reply count and
ChatView.onThreadTapopens it.finalinherited
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<ChatProduct> ? products, String? text, bool clearStatus = false, bool clearThread = false, bool clearExpiresAt = false, bool clearDeletedAt = false, bool clearScheduledFor = false}) → ProductMessage - 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}) → ProductMessage -
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