toJson method

Map<String, dynamic> toJson()

Serializes the envelope to a JSON-safe map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'schemaVersion': schemaVersion,
    'createdAtMs': createdAtMs,
    'updatedAtMs': updatedAtMs,
    'payload': payload,
    if (changeSet != null) 'changeSet': changeSet!.toJson(),
    if (saveReason != null) 'saveReason': saveReason,
    if (checksum != null) 'checksum': checksum,
  };
}