Skip to content

Commit

Permalink
pub
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Jun 24, 2021
1 parent a84e02e commit 2d88b87
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [0.3.3] - 2021-06-24

* code optimization
* code optimization & formats

## [0.3.2] - 2021-06-22

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# zxing-dart
# ZXing-Dart
[![pub package](https://img.shields.io/pub/v/zxing_lib.svg)](https://pub.dartlang.org/packages/zxing_lib)

A Dart port of [zxing](https://github.com/zxing/zxing) that encode and decode multiple 1D/2D barcodes.
Expand Down
3 changes: 2 additions & 1 deletion lib/src/common/character_set_eci.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CharacterSetECI {
static final ISO8859_16 =
CharacterSetECI('iso8859_16', 18, latin10, ['latin-10', 'iso-8859-16']);
static final SJIS = CharacterSetECI('sjis', 20, StringUtils.shiftJisCharset,
['shift-jis', 'ms932', 'iso-2022-jp', 'jis']);
['shift-jis','shift_jis', 'ms932', 'iso-2022-jp', 'jis']);
static final Cp1250 = CharacterSetECI('cp1250', 21, cp437, 'windows-1250');
static final Cp1251 = CharacterSetECI('cp1251', 22, cp437, 'windows-1251');
static final Cp1252 = CharacterSetECI('cp1252', 23, cp437, 'windows-1252');
Expand All @@ -73,6 +73,7 @@ class CharacterSetECI {
static final Big5 = CharacterSetECI('big5', 28, gbk);
static final GB18030 = CharacterSetECI(
'gb18030', 29, gbk, ['gb-2312', 'gb2312', 'euc_cn', 'gbk']);

// EUC-KR, KS_C_5601 and KS X 1001
static final EUC_KR = CharacterSetECI('euc_kr', 30, eucKr,
['ks_c_5601', 'euc-kr']);
Expand Down
26 changes: 14 additions & 12 deletions lib/src/maxicode/decoder/decoded_bit_stream_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,26 @@ class DecodedBitStreamParser {
static const String _rs = '\u001E';

static final List<String> _sets = [
"\nABCDEFGHIJKLMNOPQRSTUVWXYZ$_eci$_fs$_gs$_rs$_ns $_pad" '"' +
"\nABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"$_eci$_fs$_gs$_rs$_ns $_pad\"" +
r"#$%&'()*+,-./0123456789:" +
"$_shiftB$_shiftC$_shiftD$_shiftE$_latchB",
"`abcdefghijklmnopqrstuvwxyz$_eci$_fs$_gs$_rs$_ns{$_pad}" +
"}~\u007F;<=>?[\\]^_ ,./:@!|$_pad$_twoShiftA$_threeShiftA$_pad$_shiftA" +
"$_shiftC$_shiftD$_shiftE$_latchA",
"`abcdefghijklmnopqrstuvwxyz" +
"$_eci$_fs$_gs$_rs$_ns" +
"{$_pad}~\u007F;<=>?[\\]^_ ,./:@!|" +
"$_pad$_twoShiftA$_threeShiftA$_pad$_shiftA$_shiftC$_shiftD$_shiftE$_latchA",
"\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA" +
"$_eci$_fs$_gs$_rs$_ns"
"\u00DB\u00DC\u00DD\u00DE\u00DF\u00AA\u00AC\u00B1\u00B2\u00B3\u00B5\u00B9\u00BA\u00BC\u00BD\u00BE\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089" +
'$_latchA $_lock$_shiftD$_shiftE$_latchB',
"$_eci$_fs$_gs$_rs$_ns" +
"\u00DB\u00DC\u00DD\u00DE\u00DF\u00AA\u00AC\u00B1\u00B2\u00B3\u00B5\u00B9\u00BA\u00BC\u00BD\u00BE\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089" +
"$_latchA $_lock$_shiftD$_shiftE$_latchB",
"\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA" +
"$_eci$_fs$_gs$_rs$_ns"
"\u00FB\u00FC\u00FD\u00FE\u00FF\u00A1\u00A8\u00AB\u00AF\u00B0\u00B4\u00B7\u00B8\u00BB\u00BF\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094" +
'$_latchA $_shiftC$_lock$_shiftE$_latchB',
"$_eci$_fs$_gs$_rs$_ns" +
"\u00FB\u00FC\u00FD\u00FE\u00FF\u00A1\u00A8\u00AB\u00AF\u00B0\u00B4\u00B7\u00B8\u00BB\u00BF\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094" +
"$_latchA $_shiftC$_lock$_shiftE$_latchB",
"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A" +
'$_eci$_pad$_pad\u001B$_ns$_fs$_gs$_rs' +
"$_eci$_pad$_pad\u001B$_ns$_fs$_gs$_rs" +
"\u001F\u009F\u00A0\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A9\u00AD\u00AE\u00B6\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E" +
'$_latchA $_shiftC$_shiftD$_lock$_latchB',
"$_latchA $_shiftC$_shiftD$_lock$_latchB",
];

DecodedBitStreamParser._();
Expand Down
3 changes: 1 addition & 2 deletions lib/src/maxicode/decoder/decoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ class Decoder {
int divisor = mode == _ALL ? 1 : 2;

// First read into an array of ints
Int32List codewordsInts =
Int32List(codewords ~/ divisor); //codewords ~/ divisor
Int32List codewordsInts = Int32List(codewords ~/ divisor);
for (int i = 0; i < codewords; i++) {
if ((mode == _ALL) || (i % 2 == (mode - 1))) {
codewordsInts[i ~/ divisor] = codewordBytes[i + start] & 0xFF;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/qrcode/encoder/encoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class Encoder {
BitArray headerBits = BitArray();

// Append ECI segment if applicable
if (mode == Mode.BYTE && hasEncodingHint) {
CharacterSetECI? eci = CharacterSetECI.getCharacterSetECI(encoding!);
if (mode == Mode.BYTE && hasEncodingHint && encoding != null) {
CharacterSetECI? eci = CharacterSetECI.getCharacterSetECI(encoding);
if (eci != null) {
_appendECI(eci, headerBits);
}
Expand Down
29 changes: 2 additions & 27 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
Expand All @@ -63,7 +56,7 @@ packages:
name: charset
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0"
version: "0.1.1"
cli_util:
dependency: transitive
description:
Expand Down Expand Up @@ -120,11 +113,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
flutter:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
Expand Down Expand Up @@ -286,11 +274,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_map_stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -368,13 +351,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
vm_service:
dependency: transitive
description:
Expand Down Expand Up @@ -418,5 +394,4 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.13.0 <3.0.0"
flutter: ">=1.17.0"
dart: ">=2.12.0 <3.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
intl: ^0.17.0
fixnum: ^1.0.0
convert: ^3.0.0
charset: ^0.1.0
charset: ^0.1.1

dev_dependencies:
test:
Expand Down
4 changes: 2 additions & 2 deletions test/core/pdf417/decoder/ec/error_correction_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'dart:math';
import 'package:test/expect.dart';
import 'package:test/scaffolding.dart';
import 'package:zxing_lib/pdf417.dart';
import 'package:zxing_lib/zxing.dart';

import 'abstract_error_correction.dart';

Expand Down Expand Up @@ -85,8 +86,7 @@ void main() {
try {
checkDecode(received);
fail("Should not have decoded");
} catch (_) {
// ChecksumException
} on ChecksumException catch (_) {
// good
}
});
Expand Down
1 change: 1 addition & 0 deletions test/core/pdf417/pdf417_black_box2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void main() {
DecodeHintType.PURE_BARCODE: true,
DecodeHintType.TRY_HARDER: true,
});
print(result.text);
} on ReaderException catch (_) {}
});

Expand Down

0 comments on commit 2d88b87

Please sign in to comment.