sendMessageOnRoom method

void sendMessageOnRoom(
  1. String message,
  2. WebSocketChannel webSocketChannel,
  3. Room room
)

Implementation

void sendMessageOnRoom(
    String message, WebSocketChannel webSocketChannel, Room room) {
  Map msg = {
    "msg": "method",
    "method": "sendMessage",
    "id": "42",
    "params": [
      {"rid": room.id, "msg": message}
    ]
  };
  logInfo('🚀🚀 streamNotifyRoom $msg');
  webSocketChannel.sink.add(jsonEncode(msg));
}