From aa3fda9c88c9b932a9eeead53fd25baf7b3ba2fe Mon Sep 17 00:00:00 2001 From: alzalia1 Date: Tue, 19 Aug 2025 23:17:45 +0200 Subject: [PATCH] fix: fixed a bug that would cause empty scanned barcodes to be treated as no-empty --- lib/ui/add_page/widgets/add_page.dart | 3 +++ lib/ui/sell_page/widgets/scan_screen.dart | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/ui/add_page/widgets/add_page.dart b/lib/ui/add_page/widgets/add_page.dart index 3e85857..ab71bd4 100644 --- a/lib/ui/add_page/widgets/add_page.dart +++ b/lib/ui/add_page/widgets/add_page.dart @@ -80,6 +80,9 @@ class _AddPageState extends State { MobileScanner( controller: controller, onDetect: (barcodes) async { + if (barcodes.barcodes.isEmpty) { + return; + } if (widget.viewModel.currentOwner == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( diff --git a/lib/ui/sell_page/widgets/scan_screen.dart b/lib/ui/sell_page/widgets/scan_screen.dart index b500795..ceb9920 100644 --- a/lib/ui/sell_page/widgets/scan_screen.dart +++ b/lib/ui/sell_page/widgets/scan_screen.dart @@ -41,6 +41,9 @@ class _ScanScreenState extends State { MobileScanner( controller: controller, onDetect: (barcodes) async { + if (barcodes.barcodes.isEmpty) { + return; + } controller.stop(); showDialog( context: context,