Committed by
GitHub
Merge pull request #304 from wolfenrain/master
fix: should check for the raw bytes instead of string, in case of a malformed utf8 string
Showing
1 changed file
with
3 additions
and
3 deletions
| @@ -71,7 +71,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -71,7 +71,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | - String? lastScanned; | 74 | + Uint8List? lastScanned; |
| 75 | 75 | ||
| 76 | @override | 76 | @override |
| 77 | Widget build(BuildContext context) { | 77 | Widget build(BuildContext context) { |
| @@ -84,8 +84,8 @@ class _MobileScannerState extends State<MobileScanner> | @@ -84,8 +84,8 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 84 | } else { | 84 | } else { |
| 85 | controller.barcodes.listen((barcode) { | 85 | controller.barcodes.listen((barcode) { |
| 86 | if (!widget.allowDuplicates) { | 86 | if (!widget.allowDuplicates) { |
| 87 | - if (lastScanned != barcode.rawValue) { | ||
| 88 | - lastScanned = barcode.rawValue; | 87 | + if (lastScanned != barcode.rawBytes) { |
| 88 | + lastScanned = barcode.rawBytes; | ||
| 89 | widget.onDetect(barcode, value! as MobileScannerArguments); | 89 | widget.onDetect(barcode, value! as MobileScannerArguments); |
| 90 | } | 90 | } |
| 91 | } else { | 91 | } else { |
-
Please register or login to post a comment