Message.audio constructor
const
Message.audio({
- 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 source,
- @DurationConverter() required Duration duration,
- String? text,
- int? size,
- List<
double> ? waveform,
Creates an audio message.
Implementation
const factory Message.audio({
/// Unique identifier for the message.
required MessageID id,
/// ID of the user who sent the message.
required UserID authorId,
/// ID of the message this one is replying to.
MessageID? replyToMessageId,
/// Timestamp when the message was created.
@EpochDateTimeConverter() DateTime? createdAt,
/// Timestamp when the message was marked as deleted.
@EpochDateTimeConverter() DateTime? deletedAt,
/// Timestamp when the message failed to send.
@EpochDateTimeConverter() DateTime? failedAt,
/// Timestamp when the message was successfully sent.
@EpochDateTimeConverter() DateTime? sentAt,
/// Timestamp when the message was delivered to the recipient.
@EpochDateTimeConverter() DateTime? deliveredAt,
/// Timestamp when the message was seen by the recipient.
@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,
/// Source URL or path of the audio.
required String source,
/// Duration of the audio.
@DurationConverter() required Duration duration,
/// Optional text caption accompanying the audio.
String? text,
/// Size of the audio in bytes.
int? size,
/// Waveform data for the audio.
List<double>? waveform,
}) = AudioMessage;