mapRecordToJson method
Maps any Records known to this Protocol to their JSON representation
Throws in case the record type is not known.
This method will return null (only) for null inputs.
Implementation
Map<String, dynamic>? mapRecordToJson(Record? record) {
if (record == null) {
return null;
}
throw Exception('Unsupported record type ${record.runtimeType}');
}