From 20f8d5788c37589a73add9869f9595ea02065450 Mon Sep 17 00:00:00 2001 From: efrilm Date: Wed, 6 Aug 2025 13:51:49 +0700 Subject: [PATCH] fix: payment page --- lib/presentation/payment/pages/payment_page.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/presentation/payment/pages/payment_page.dart b/lib/presentation/payment/pages/payment_page.dart index 393bc33..4f5922f 100644 --- a/lib/presentation/payment/pages/payment_page.dart +++ b/lib/presentation/payment/pages/payment_page.dart @@ -31,6 +31,13 @@ class _PaymentPageState extends State { final int uangPas2 = 50000; final int uangPas3 = 100000; + List getOrderItemPending() { + final itemPending = widget.order.orderItems + ?.where((item) => item.status == "pending") + .toList(); + return itemPending ?? []; + } + @override void initState() { super.initState(); @@ -100,7 +107,7 @@ class _PaymentPageState extends State { final items = order.orderItems ?? []; return Card( - elevation: 4, + elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), color: AppColors.white, child: Padding( @@ -131,11 +138,11 @@ class _PaymentPageState extends State { ? const Center(child: Text('Tidak ada item')) : ListView.separated( shrinkWrap: true, - itemCount: items.length, + itemCount: getOrderItemPending().length, separatorBuilder: (_, __) => Divider(color: AppColors.grey.withOpacity(0.5)), itemBuilder: (context, index) { - final item = items[index]; + final item = getOrderItemPending()[index]; return ListTile( contentPadding: EdgeInsets.zero, title: Text(item.productName ?? '-'), @@ -186,7 +193,7 @@ class _PaymentPageState extends State { Widget _buildPaymentForm(int totalAmount) { return Card( - elevation: 4, + elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), color: AppColors.white, child: Padding(