From a893d51e3cd1f50c57822b7300c82c3dc9ada0a8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 11 Dec 2024 13:40:39 +1100 Subject: [PATCH] Cleanup --- lib/barcode/camera_controller.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/barcode/camera_controller.dart b/lib/barcode/camera_controller.dart index fb88a626..0932995c 100644 --- a/lib/barcode/camera_controller.dart +++ b/lib/barcode/camera_controller.dart @@ -203,13 +203,19 @@ class _CameraBarcodeControllerState extends InvenTreeBarcodeControllerState { String info_text = scanning_paused ? L10().barcodeScanPaused : L10().barcodeScanPause; + String text = scanned_code.isNotEmpty ? scanned_code : info_text; + + if (text.length > 50) { + text = text.substring(0, 50) + "..."; + } + return SafeArea( child: Align( alignment: Alignment.bottomCenter, child: Padding( padding: EdgeInsets.all(10), child: Text( - scanned_code.isNotEmpty ? scanned_code : info_text, + text, textAlign: TextAlign.center, style: TextStyle( color: Colors.white,