decode method Null safety

XdrSCSpecUDTUnionCaseTupleV0 decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrSCSpecUDTUnionCaseTupleV0 decode(XdrDataInputStream stream) {
  String doc = stream.readString();
  int namesSize = stream.readInt();
  List<String> name = List<String>.empty(growable: true);
  for (int i = 0; i < namesSize; i++) {
    name.add(stream.readString());
  }
  XdrSCSpecTypeDef? typ;
  int typePresent = stream.readInt();
  if (typePresent != 0) {
    typ = XdrSCSpecTypeDef.decode(stream);
  }
  return XdrSCSpecUDTUnionCaseTupleV0(doc, name, typ);
}