Record.suffix constructor Null safety

Record.suffix(
  1. int startAddress,
  2. Iterable<int?> data,
  3. int size
)

Implementation

factory Record.suffix(int startAddress, Iterable<int?> data, int size) {
  if (data.length != size) {
    data = <int?>[...data, ...List<int?>.filled(size - data.length, null)];

    startAddress -= data.length - size;
  }

  return Record(startAddress, data.toList());
}