sentTo method

void sentTo({
  1. required String event,
  2. dynamic data,
})

Emits an event with optional data to the socket.

event is the name of the event to emit. data is the optional payload to send with the event.

Implementation

void sentTo({required String event, dynamic data}) {
  _socket.emit(event, data);
}