Skip to content

Commit d926148

Browse files
committed
1.5.2
1 parent 62f2abc commit d926148

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.5.2
2+
- fix
13
## 1.5.1
24
- support android invert color qrcode
35
## 1.5.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# scan
22

3-
[![scan](https://img.shields.io/badge/pub-1.5.1-orange)](https://pub.dev/packages/scan)
3+
[![scan](https://img.shields.io/badge/pub-1.5.2-orange)](https://pub.dev/packages/scan)
44

55
scan qrcode & barcode in widget tree.
66

android/src/main/java/com/chavesgu/scan/QRCodeDecoder.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@
3232
public class QRCodeDecoder {
3333
private static byte[] yuvs;
3434
public static int MAX_PICTURE_PIXEL = 256;
35-
public static final List<BarcodeFormat> allFormats = new ArrayList<>();
36-
public static final Map<DecodeHintType, Object> HINTS = new EnumMap<>(DecodeHintType.class);
35+
public static final List<BarcodeFormat> allFormats = new ArrayList<BarcodeFormat>() {{
36+
add(BarcodeFormat.AZTEC);
37+
add(BarcodeFormat.CODABAR);
38+
add(BarcodeFormat.CODE_39);
39+
add(BarcodeFormat.CODE_93);
40+
add(BarcodeFormat.CODE_128);
41+
add(BarcodeFormat.DATA_MATRIX);
42+
add(BarcodeFormat.EAN_8);
43+
add(BarcodeFormat.EAN_13);
44+
add(BarcodeFormat.ITF);
45+
add(BarcodeFormat.MAXICODE);
46+
add(BarcodeFormat.PDF_417);
47+
add(BarcodeFormat.QR_CODE);
48+
add(BarcodeFormat.RSS_14);
49+
add(BarcodeFormat.RSS_EXPANDED);
50+
add(BarcodeFormat.UPC_A);
51+
add(BarcodeFormat.UPC_E);
52+
add(BarcodeFormat.UPC_EAN_EXTENSION);
53+
}};
54+
public static final Map<DecodeHintType, Object> HINTS = new EnumMap<DecodeHintType, Object>(DecodeHintType.class) {{
55+
put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
56+
put(DecodeHintType.POSSIBLE_FORMATS, allFormats);
57+
put(DecodeHintType.CHARACTER_SET, "utf-8");
58+
}};
3759
public static void config() {
38-
HINTS.clear();
39-
allFormats.add(BarcodeFormat.AZTEC);
40-
allFormats.add(BarcodeFormat.CODABAR);
41-
allFormats.add(BarcodeFormat.CODE_39);
42-
allFormats.add(BarcodeFormat.CODE_93);
43-
allFormats.add(BarcodeFormat.CODE_128);
44-
allFormats.add(BarcodeFormat.DATA_MATRIX);
45-
allFormats.add(BarcodeFormat.EAN_8);
46-
allFormats.add(BarcodeFormat.EAN_13);
47-
allFormats.add(BarcodeFormat.ITF);
48-
allFormats.add(BarcodeFormat.MAXICODE);
49-
allFormats.add(BarcodeFormat.PDF_417);
50-
allFormats.add(BarcodeFormat.QR_CODE);
51-
allFormats.add(BarcodeFormat.RSS_14);
52-
allFormats.add(BarcodeFormat.RSS_EXPANDED);
53-
allFormats.add(BarcodeFormat.UPC_A);
54-
allFormats.add(BarcodeFormat.UPC_E);
55-
allFormats.add(BarcodeFormat.UPC_EAN_EXTENSION);
56-
HINTS.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
57-
HINTS.put(DecodeHintType.POSSIBLE_FORMATS, allFormats);
58-
HINTS.put(DecodeHintType.CHARACTER_SET, "utf-8");
59-
// HINTS.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE);
6060
}
6161
public static String syncDecodeQRCode(String path) {
6262
config();

android/src/main/java/com/chavesgu/scan/ScanViewNew.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public ScanViewNew(Context context, Activity activity, @NonNull ActivityPluginBi
8080

8181
private void start() {
8282
addListenLifecycle();
83-
QRCodeDecoder.config();
8483
this.setDecoderFactory(new DefaultDecoderFactory(QRCodeDecoder.allFormats, QRCodeDecoder.HINTS, "utf-8", 2));
8584
this.decodeContinuous(new BarcodeCallback() {
8685
@Override

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: scan
22
description: scan qrcode & barcode in widget tree with custom options.Accurately decode qrcode & barcode image from path.
3-
version: 1.5.1
3+
version: 1.5.2
44
homepage: https://github.com/flutter-package/flutter_scan
55

66
environment:

0 commit comments

Comments
 (0)