sendChange method

void sendChange({
  1. required MessageType type,
  2. required String collection,
  3. required String recordId,
  4. Map<String, dynamic>? data,
})

Send local change to server via WebSocket

Implementation

void sendChange({
  required MessageType type,
  required String collection,
  required String recordId,
  Map<String, dynamic>? data,
}) {
  if (!isActive) {
    _logger.warning('Cannot send change - real-time sync not active');
    return;
  }

  _websocketService.send(WebSocketMessage(
    type: type,
    collection: collection,
    recordId: recordId,
    data: data,
    timestamp: DateTime.now(),
  ));
}