sendMessage method
Implementation
Future<void> sendMessage({required String type, required Map<String, dynamic> message, Uint8List? attachment}) async {
if (_state != _MessagingStreamState.accepted) {
throw RoomServerException('the messaging stream is closed');
}
await _input.add(_messageContent(type: type, message: message, attachment: attachment), wait: true);
}