send method

void send(
  1. dynamic message
)

Sends a message to the client.

If the message is a Map or List, it is automatically encoded to a JSON string. Otherwise, it is sent as-is.

Implementation

void send(dynamic message) {
  if (message is Map || message is List) {
    socket.add(jsonEncode(message));
  } else {
    socket.add(message);
  }
}