From 2a6ec8f6b8146950f07fd1eb608071827d13b0de Mon Sep 17 00:00:00 2001 From: renolation Date: Sun, 2 Nov 2025 23:24:50 +0700 Subject: [PATCH] print => save --- .../presentation/pages/product_detail_page.dart | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/features/products/presentation/pages/product_detail_page.dart b/lib/features/products/presentation/pages/product_detail_page.dart index 8c69d66..56c0bc7 100644 --- a/lib/features/products/presentation/pages/product_detail_page.dart +++ b/lib/features/products/presentation/pages/product_detail_page.dart @@ -787,6 +787,9 @@ class _ProductDetailPageState extends ConsumerState { return; } + // Print before saving to API + await _printQuantities(stage); + // Show loading dialog showDialog( context: context, @@ -865,16 +868,6 @@ class _ProductDetailPageState extends ConsumerState { widget.productId, ); - // Get updated stage data - final updatedStages = ref.read(productDetailProvider(_providerKey)).stages; - final updatedStage = updatedStages.firstWhere( - (s) => s.productStageId == stage.productStageId, - orElse: () => stage, - ); - - // Automatically print after successful save - await _printQuantities(updatedStage); - // Do NOT clear quantity/weight fields - keep them for reference // User can manually clear them if needed using the 'C' button }