getPackQuantity method

double? getPackQuantity({
  1. String? headerMaterial,
})

Implementation

double? getPackQuantity({
  String? headerMaterial,
}) {
  HuItem? huItem = this?.toHuItem?.firstWhereOrNull((i) {
    if (headerMaterial != null) return i.material == headerMaterial;
    return i.huItemType == '1';
  });

  bool hasPackQty = huItem?.packQuantity?.isNotEmpty ?? false;

  if (hasPackQty) {
    return huItem?.packQuantity?.quantityFromString(
      regionString: DeviceLocale.regionString,
    );
  }

  return null;
}