fixed tag model

This commit is contained in:
hannathkadher
2025-01-05 21:16:59 +04:00
parent 5bd257ee56
commit 0fda5457ae
9 changed files with 53 additions and 41 deletions

View File

@ -114,7 +114,7 @@ class _AddDeviceWidgetState extends State<AddDeviceWidget> {
Widget _buildDeviceTypeTile(ProductModel product, Size size) {
final selectedProduct = productCounts.firstWhere(
(p) => p.productId == product.uuid,
orElse: () => SelectedProduct(productId: product.uuid, count: 0),
orElse: () => SelectedProduct(productId: product.uuid, count: 0, productName: product.catName),
);
return SizedBox(
@ -143,7 +143,7 @@ class _AddDeviceWidgetState extends State<AddDeviceWidget> {
if (newCount > 0) {
if (!productCounts.contains(selectedProduct)) {
productCounts
.add(SelectedProduct(productId: product.uuid, count: newCount));
.add(SelectedProduct(productId: product.uuid, count: newCount, productName: product.catName));
} else {
selectedProduct.count = newCount;
}