decode method
Implementation
@override
Future<TransactionReference> decode(EncodedContent encodedContent) async {
final jsonString = utf8.decode(encodedContent.content);
final decoded = jsonDecode(jsonString);
if (decoded is! Map) {
throw FormatException(
'TransactionReference: expected a JSON object, got ${decoded.runtimeType}');
}
// fromJson tolerates both the canonical flat object and a wrapped envelope.
return TransactionReference.fromJson(Map<String, dynamic>.from(decoded));
}