barcode_format.dart
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
enum BarcodeFormat {
/// Barcode format unknown to the current SDK.
///
/// Constant Value: -1
unknown,
/// Barcode format constant representing the union of all supported formats.
///
/// Constant Value: 0
all,
/// Barcode format constant for Code 128.
///
/// Constant Value: 1
code128,
/// Barcode format constant for Code 39.
///
/// Constant Value: 2
code39,
/// Barcode format constant for Code 93.
///
/// Constant Value: 4
code93,
/// Barcode format constant for Codabar.
///
/// Constant Value: 8
codebar,
/// Barcode format constant for Data Matrix.
///
/// Constant Value: 16
dataMatrix,
/// Barcode format constant for EAN-13.
///
/// Constant Value: 32
ean13,
/// Barcode format constant for EAN-8.
///
/// Constant Value: 64
ean8,
/// Barcode format constant for ITF (Interleaved Two-of-Five).
///
/// Constant Value: 128
itf,
/// Barcode format constant for QR Code.
///
/// Constant Value: 256
qrCode,
/// Barcode format constant for UPC-A.
///
/// Constant Value: 512
upcA,
/// Barcode format constant for UPC-E.
///
/// Constant Value: 1024
upcE,
/// Barcode format constant for PDF-417.
///
/// Constant Value: 2048
pdf417,
/// Barcode format constant for AZTEC.
///
/// Constant Value: 4096
aztec,
}
extension BarcodeValue on BarcodeFormat {
int get rawValue {
switch (this) {
case BarcodeFormat.unknown:
return -1;
case BarcodeFormat.all:
return 0;
case BarcodeFormat.code128:
return 1;
case BarcodeFormat.code39:
return 2;
case BarcodeFormat.code93:
return 4;
case BarcodeFormat.codebar:
return 8;
case BarcodeFormat.dataMatrix:
return 16;
case BarcodeFormat.ean13:
return 32;
case BarcodeFormat.ean8:
return 64;
case BarcodeFormat.itf:
return 128;
case BarcodeFormat.qrCode:
return 256;
case BarcodeFormat.upcA:
return 512;
case BarcodeFormat.upcE:
return 1024;
case BarcodeFormat.pdf417:
return 2048;
case BarcodeFormat.aztec:
return 4096;
}
}
}