Skip to content

Commit

Permalink
Merge pull request #815 from navaronbracke/reorganise_classes
Browse files Browse the repository at this point in the history
fix: fix typo in `codebar` constant
  • Loading branch information
navaronbracke authored Oct 23, 2023
2 parents cb842e6 + 913273f commit eb4e241
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/src/enums/barcode_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/web/zxing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/enums/barcode_format_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit eb4e241

Please sign in to comment.