sendMessage method
Implementation
Future<void> sendMessage({
required Participant to,
required String type,
required Map<String, dynamic> message,
Uint8List? attachment,
bool ignoreOffline = false,
}) async {
if (_sendTask == null) {
throw RoomServerException("Cannot send messages because messaging has not been started");
}
final queued = _QueuedRoomMessage(
fromParticipantId: room.localParticipant?.id ?? "",
to: to,
type: type,
message: message,
attachment: attachment,
dropIfOffline: ignoreOffline,
);
_queueMessage(queued);
final completer = queued.completer;
if (completer != null) {
await completer.future;
}
}