emit method
Emits a custom event, optionally with data. No-ops (with a debug
log) if the socket isn't currently connected.
Implementation
void emit(String event, [dynamic data]) {
if (_socket?.connected != true) {
debugPrint("SmartApiSocket: emit(\"$event\") skipped — not connected");
return;
}
_socket?.emit(event, data);
}