diff --git a/lib/src/enums/barcode_format.dart b/lib/src/enums/barcode_format.dart index e8570f01b..9f9cdb822 100644 --- a/lib/src/enums/barcode_format.dart +++ b/lib/src/enums/barcode_format.dart @@ -16,7 +16,7 @@ enum BarcodeFormat { code93(4), /// Barcode format constant for Codabar. - codebar(8), + codabar(8), /// Barcode format constant for Data Matrix. dataMatrix(16), @@ -45,6 +45,12 @@ enum BarcodeFormat { /// Barcode format constant for AZTEC. aztec(4096); + /// This constant represents the old value for [BarcodeFormat.codabar]. + /// + /// Prefer using the new [BarcodeFormat.codabar] constant, + /// as the `codebar` value will be removed in a future release. + static const BarcodeFormat codebar = codabar; + const BarcodeFormat(this.rawValue); factory BarcodeFormat.fromRawValue(int value) { diff --git a/lib/src/web/zxing.dart b/lib/src/web/zxing.dart index 6efe8bf4a..5cfb6f831 100644 --- a/lib/src/web/zxing.dart +++ b/lib/src/web/zxing.dart @@ -107,7 +107,7 @@ extension ZXingBarcodeFormat on BarcodeFormat { switch (this) { case BarcodeFormat.aztec: return 0; - case BarcodeFormat.codebar: + case BarcodeFormat.codabar: return 1; case BarcodeFormat.code39: return 2; diff --git a/test/enums/barcode_format_test.dart b/test/enums/barcode_format_test.dart index b4a1f15ad..9ef915a50 100644 --- a/test/enums/barcode_format_test.dart +++ b/test/enums/barcode_format_test.dart @@ -10,7 +10,7 @@ void main() { 1: BarcodeFormat.code128, 2: BarcodeFormat.code39, 4: BarcodeFormat.code93, - 8: BarcodeFormat.codebar, + 8: BarcodeFormat.codabar, 16: BarcodeFormat.dataMatrix, 32: BarcodeFormat.ean13, 64: BarcodeFormat.ean8, @@ -44,7 +44,7 @@ void main() { BarcodeFormat.code128: 1, BarcodeFormat.code39: 2, BarcodeFormat.code93: 4, - BarcodeFormat.codebar: 8, + BarcodeFormat.codabar: 8, BarcodeFormat.dataMatrix: 16, BarcodeFormat.ean13: 32, BarcodeFormat.ean8: 64,