static bool isBarcodeValid(String barcode) { return (barcode.length == 8 || barcode.length == 13) && int.tryParse(barcode) != null; }