From 1b59837b3b809b0e239010b1e5467c41c037d689 Mon Sep 17 00:00:00 2001 From: Ben Hagen Date: Tue, 1 Jul 2025 08:34:17 +0200 Subject: [PATCH] Use raw value of UTF-8 encoded barcodes (#670) --- lib/barcode/camera_controller.dart | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/barcode/camera_controller.dart b/lib/barcode/camera_controller.dart index 9e2fe501..ba73b10f 100644 --- a/lib/barcode/camera_controller.dart +++ b/lib/barcode/camera_controller.dart @@ -1,5 +1,4 @@ import "dart:math"; -import "dart:typed_data"; import "package:camera/camera.dart"; import "package:flutter/material.dart"; @@ -126,24 +125,7 @@ class _CameraBarcodeControllerState extends InvenTreeBarcodeControllerState { }); } - Uint8List rawData = result.barcodes.first.rawBytes ?? Uint8List(0); - - String barcode; - - if (rawData.isNotEmpty) { - final buffer = StringBuffer(); - - for (int ii = 0; ii < rawData.length; ii++) { - buffer.writeCharCode(rawData[ii]); - } - - barcode = buffer.toString(); - - print(barcode); - } else { - // Fall back to text value - barcode = result.barcodes.first.rawValue ?? ""; - } + String barcode = result.barcodes.first.rawValue ?? ""; if (barcode.isEmpty) { // TODO: Error message "empty barcode"