add decrease increase qty on possales

This commit is contained in:
2026-02-08 10:49:18 +07:00
parent dc1147fd9e
commit 0bebe34f19

View File

@@ -925,7 +925,7 @@ class _PosSaleScreenState extends ConsumerState<PosSaleScreen> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = providerData.cartItemList[index]; final item = providerData.cartItemList[index];
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@@ -940,9 +940,9 @@ class _PosSaleScreenState extends ConsumerState<PosSaleScreen> {
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
'$currency${item.unitPrice} x ${item.quantity}', '$currency${item.unitPrice}',
style: TextStyle( style: TextStyle(
color: kSubPeraColor, color: kSubPeraColor,
fontSize: 12, fontSize: 12,
@@ -951,14 +951,53 @@ class _PosSaleScreenState extends ConsumerState<PosSaleScreen> {
], ],
), ),
), ),
const SizedBox(width: 8),
Row(
children: [
GestureDetector(
onTap: () {
providerData.quantityDecrease(index);
},
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: kMainColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(4),
),
child: const Icon(Icons.remove, size: 16, color: kMainColor),
),
),
const SizedBox(width: 8),
Text(
'${item.quantity}',
style: const TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
providerData.quantityIncrease(index);
},
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: kMainColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(4),
),
child: const Icon(Icons.add, size: 16, color: kMainColor),
),
),
],
),
const SizedBox(width: 12),
Text( Text(
'$currency${(item.unitPrice ?? 0) * (item.quantity ?? 0)}', '$currency${(item.unitPrice ?? 0) * (item.quantity ?? 0)}',
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: kMainColor, color: kMainColor,
fontSize: 14,
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 12),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
providerData.deleteToCart(index); providerData.deleteToCart(index);