message method

void message(
  1. String text, {
  2. String? device,
})

Sends a message to connected clients.

Implementation

void message(String text, {String? device}) {
  for (final connection in connections) {
    if (device == null || connection._wants(device, null)) {
      connection.send(MessageCommand(device: device, message: text));
    }
  }
}