quantityWithUnit property

({double? quantity, String? unit}) get quantityWithUnit

Implementation

({double? quantity, String? unit}) get quantityWithUnit {
  double? returnQuantity;
  String? returnUnit;
  if (netWeightKg != null) {
    returnQuantity = netWeightKg;
    returnUnit = 'KG';
  } else if (netWeightPounds != null) {
    returnQuantity = netWeightPounds;
    returnUnit = 'LB';
  } else if (lengthMeters != null) {
    returnQuantity = lengthMeters;
    returnUnit = 'M';
  } else if (widthMeters != null) {
    returnQuantity = widthMeters;
    returnUnit = 'M';
  } else if (depthMeters != null) {
    returnQuantity = depthMeters;
    returnUnit = 'M';
  } else if (areaSqMeters != null) {
    returnQuantity = areaSqMeters;
    returnUnit = 'M2';
  } else if (volumeLitres != null) {
    returnQuantity = volumeLitres;
    returnUnit = 'L';
  } else if (volumeCubicMeters != null) {
    returnQuantity = volumeCubicMeters;
    returnUnit = 'M3';
  } else if (quantity != null) {
    returnQuantity = quantity;
  }
  return (quantity: returnQuantity, unit: returnUnit);
}