broadcastMessage method

void broadcastMessage(
  1. NearbyMessage message
)

Broadcasts a message to every connected device

Implementation

void broadcastMessage(NearbyMessage message) {
  for (var device in connectedDevices) {
    device.sendMessage(message);
  }
}