getRowHeights method

List<int>? getRowHeights()

Implementation

List<int>? getRowHeights() {
  final barcodeMetadata = getBarcodeMetadata();
  if (barcodeMetadata == null) {
    return null;
  }
  _adjustIncompleteIndicatorColumnRowNumbers(barcodeMetadata);
  final result = List.filled(barcodeMetadata.rowCount, 0);
  for (Codeword? codeword in codewords) {
    if (codeword != null) {
      final rowNumber = codeword.rowNumber;
      if (rowNumber >= result.length) {
        // We have more rows than the barcode metadata allows for, ignore them.
        continue;
      }
      result[rowNumber]++;
    } // else throw exception?
  }
  return result;
}