diff --git a/lib/features/products/data/datasources/products_remote_datasource.dart b/lib/features/products/data/datasources/products_remote_datasource.dart index 909969c..31c2697 100644 --- a/lib/features/products/data/datasources/products_remote_datasource.dart +++ b/lib/features/products/data/datasources/products_remote_datasource.dart @@ -102,7 +102,7 @@ class ProductsRemoteDataSourceImpl implements ProductsRemoteDataSource { // The API returns a list of stages for the product final list = json as List; if (list.isEmpty) { - throw const ServerException('Product stages not found'); + throw const ServerException('Không tìm thấy sản phẩm'); } // Parse all stages from the list return list diff --git a/lib/features/products/presentation/pages/product_detail_page.dart b/lib/features/products/presentation/pages/product_detail_page.dart index 5665db7..bad49f7 100644 --- a/lib/features/products/presentation/pages/product_detail_page.dart +++ b/lib/features/products/presentation/pages/product_detail_page.dart @@ -418,7 +418,7 @@ class _ProductDetailPageState extends ConsumerState { ), const SizedBox(height: 16), Text( - 'Error', + 'Lỗi', style: theme.textTheme.titleLarge?.copyWith( color: theme.colorScheme.error, ), @@ -788,8 +788,7 @@ class _ProductDetailPageState extends ConsumerState { return; } - // Print before saving to API - await _printQuantities(stage); + // Show loading dialog showDialog( @@ -863,6 +862,9 @@ class _ProductDetailPageState extends ConsumerState { ), ); + // Print before saving to API + await _printQuantities(stage); + // Refresh the product detail to show updated quantities await ref.read(productDetailProvider(_providerKey).notifier).refreshProductDetail( widget.warehouseId,