sendMessage static method
OutboundOperation
sendMessage({
- required String messageId,
- required String conversationId,
- required String content,
- MessageType? type,
- String? replyToId,
- List<
PendingAttachment> ? attachments, - String? nonce,
- Map<
String, dynamic> ? extra,
Helper to create a send message operation.
Implementation
static OutboundOperation sendMessage({
required String messageId,
required String conversationId,
required String content,
MessageType? type,
String? replyToId,
List<PendingAttachment>? attachments,
String? nonce,
Map<String, dynamic>? extra,
}) {
return OutboundOperation(
id: DateTime.now().millisecondsSinceEpoch.toString(),
type: OutboundOperationType.sendMessage,
data: jsonEncode({
'messageId': messageId,
'conversationId': conversationId,
'content': content,
'type': type?.name,
'replyToId': replyToId,
'attachments': attachments
?.map(
(a) => {
'filePath': a.filePath,
'fileName': a.fileName,
'mimeType': a.mimeType,
},
)
.toList(),
'nonce': nonce,
'extra': extra,
}),
);
}