fix: payment page
This commit is contained in:
parent
f067417ab2
commit
20f8d5788c
@ -31,6 +31,13 @@ class _PaymentPageState extends State<PaymentPage> {
|
|||||||
final int uangPas2 = 50000;
|
final int uangPas2 = 50000;
|
||||||
final int uangPas3 = 100000;
|
final int uangPas3 = 100000;
|
||||||
|
|
||||||
|
List<OrderItem> getOrderItemPending() {
|
||||||
|
final itemPending = widget.order.orderItems
|
||||||
|
?.where((item) => item.status == "pending")
|
||||||
|
.toList();
|
||||||
|
return itemPending ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@ -100,7 +107,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
|||||||
final items = order.orderItems ?? [];
|
final items = order.orderItems ?? [];
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
color: AppColors.white,
|
color: AppColors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -131,11 +138,11 @@ class _PaymentPageState extends State<PaymentPage> {
|
|||||||
? const Center(child: Text('Tidak ada item'))
|
? const Center(child: Text('Tidak ada item'))
|
||||||
: ListView.separated(
|
: ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: items.length,
|
itemCount: getOrderItemPending().length,
|
||||||
separatorBuilder: (_, __) =>
|
separatorBuilder: (_, __) =>
|
||||||
Divider(color: AppColors.grey.withOpacity(0.5)),
|
Divider(color: AppColors.grey.withOpacity(0.5)),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final item = items[index];
|
final item = getOrderItemPending()[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
title: Text(item.productName ?? '-'),
|
title: Text(item.productName ?? '-'),
|
||||||
@ -186,7 +193,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
|||||||
|
|
||||||
Widget _buildPaymentForm(int totalAmount) {
|
Widget _buildPaymentForm(int totalAmount) {
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
color: AppColors.white,
|
color: AppColors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user