getUnitItemCode method

String? getUnitItemCode(
  1. GS1Barcode gs1barcode
)

Implementation

String? getUnitItemCode(GS1Barcode gs1barcode) {
  final String barcode = gs1barcode.elements.entries.fold(
    '',
    (prevValue, entry) => prevValue += entry.value.rawData,
  );

  if (gs1barcode.AIs.isNotEmpty &&
      gs1barcode.AIs.every(_validItemAiList.contains) &&
      barcode.isNotEmpty) {
    return barcode;
  } else {
    return null;
  }
}