GetLedgerEntryResponse.fromJson constructor Null safety

GetLedgerEntryResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory GetLedgerEntryResponse.fromJson(Map<String, dynamic> json) {
  GetLedgerEntryResponse response = GetLedgerEntryResponse(json);

  if (json['result'] != null) {
    response.ledgerEntryData = json['result']['xdr'];
    response.lastModifiedLedgerSeq = json['result']['lastModifiedLedgerSeq'];
    response.latestLedger = json['result']['latestLedger'];
  } else if (json['error'] != null) {
    response.error = SorobanRpcErrorResponse.fromJson(json);
  }
  return response;
}