Message.system constructor
const
Message.system({
- required MessageID id,
- required UserID authorId,
- MessageID? replyToMessageId,
- @EpochDateTimeConverter() DateTime? createdAt,
- @EpochDateTimeConverter() DateTime? deletedAt,
- @EpochDateTimeConverter() DateTime? failedAt,
- @EpochDateTimeConverter() DateTime? sentAt,
- @EpochDateTimeConverter() DateTime? deliveredAt,
- @EpochDateTimeConverter() DateTime? seenAt,
- @EpochDateTimeConverter() DateTime? updatedAt,
- Map<
String, List< ? reactions,UserID> > - bool? pinned,
- Map<
String, dynamic> ? metadata, - MessageStatus? status,
- required String text,
Creates a system message (e.g., "User joined the chat").
Implementation
const factory Message.system({
/// Unique identifier for the message.
required MessageID id,
/// ID of the user associated with the system event (often a system ID).
required UserID authorId,
/// ID of the message this one is replying to (usually null for system messages).
MessageID? replyToMessageId,
/// Timestamp when the system event occurred.
@EpochDateTimeConverter() DateTime? createdAt,
/// Timestamp when the message was marked as deleted.
@EpochDateTimeConverter() DateTime? deletedAt,
/// Timestamp when the message failed to send (usually null for system messages).
@EpochDateTimeConverter() DateTime? failedAt,
/// Timestamp when the message was successfully sent (usually null for system messages).
@EpochDateTimeConverter() DateTime? sentAt,
/// Timestamp when the message was delivered (usually null for system messages).
@EpochDateTimeConverter() DateTime? deliveredAt,
/// Timestamp when the message was seen (usually null for system messages).
@EpochDateTimeConverter() DateTime? seenAt,
/// Timestamp when the message was last updated.
@EpochDateTimeConverter() DateTime? updatedAt,
/// Map of reaction keys to lists of user IDs who reacted.
Map<String, List<UserID>>? reactions,
/// Indicates if the message is pinned.
bool? pinned,
/// Additional custom metadata associated with the message.
Map<String, dynamic>? metadata,
/// Status of the message. Takes precedence over the timestamp based status.
/// If not provided, the status is determined by createdAt, sentAt, seenAt etc.
MessageStatus? status,
/// The text content of the system message.
required String text,
}) = SystemMessage;