decode method Null safety

XdrAccountEntryV2 decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrAccountEntryV2 decode(XdrDataInputStream stream) {
  XdrUint32 xNumSponsored = XdrUint32.decode(stream);
  XdrUint32 xNumSponsoring = XdrUint32.decode(stream);
  int pSize = stream.readInt();
  List<XdrAccountID?> xSignerSponsoringIDs = <XdrAccountID?>[]..length =
      pSize;
  for (int i = 0; i < pSize; i++) {
    int sponsoringIDPresent = stream.readInt();
    if (sponsoringIDPresent != 0) {
      xSignerSponsoringIDs[i] = XdrAccountID.decode(stream);
    }
  }
  XdrAccountEntryV2Ext xExt = XdrAccountEntryV2Ext.decode(stream);

  return XdrAccountEntryV2(
      xNumSponsored, xNumSponsoring, xSignerSponsoringIDs, xExt);
}