emit method

bool emit(
  1. String event, {
  2. dynamic data,
})

Emits the event with payload data optionally.

If the socket is null, the method returns false.

Implementation

bool emit(String event, {dynamic data}) {
  if (!isConnected) {
    config.logger.e('Socket is not connected to emit , $event, $data');
    return false;
  }
  _socket!.emit(event, data);
  return true;
}