registerCustomSocketEvents method

void registerCustomSocketEvents(
  1. Map<String, dynamic Function(dynamic)> customEvents
)

Implementation

void registerCustomSocketEvents(Map<String, Function(dynamic)> customEvents) {
  if (_socket == null) {
    _log('Cannot register custom events: socket not initialized');
    return;
  }

  for (var entry in customEvents.entries) {
    _socket!.on(entry.key, entry.value);
  }
}