toJsonForProtocol method

  1. @override
Map<String, dynamic> toJsonForProtocol()

Returns a JSON structure of the model, optimized for Protocol communication.

Implementation

@override
Map<String, dynamic> toJsonForProtocol() {
  return {
    '__className__': 'serverpod_offline_sync.CrdtDataAttemptedValue',
    if (id != null) 'id': id,
    'fieldId': fieldId,
    if (field != null) 'field': field?.toJsonForProtocol(),
    'value': _icw2tu00.Protocol().dynamicFieldToJson(
      value,
      forProtocol: true,
    ),
    'projectionReason': projectionReason.toJson(),
  };
}