From e4d084e962117f27729a455d679f32beb611a3d3 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 23 Oct 2023 15:08:39 +0200 Subject: [PATCH] fix typo in `codebar` constant --- lib/src/enums/barcode_format.dart | 8 +++++++- lib/src/web/zxing.dart | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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;