off method

void off(
  1. String event, {
  2. SocketIOHandler? handler,
})

Unsubscribe from the event if the socket isConnected.

Optionally can specify a handler to be triggered after the event is not listened to.

Implementation

void off(String event, {SocketIOHandler? handler}) {
  if (isConnected) _socket!.off(event, handler);
}