encode method
Implementation
@override
Future<Map<String, dynamic>> encode(dynamic content) async {
if (content is! Reaction) {
throw const FormatException('Content must be Reaction');
}
final reactionData = {
'reference': content.reference,
'action': content.action.toString().split('.').last,
'content': content.content,
'schema': content.schema,
};
return {
'content': Uint8List.fromList(utf8.encode(jsonEncode(reactionData))),
'parameters': <String, dynamic>{},
};
}