create order

This commit is contained in:
efrilm
2025-10-28 00:08:12 +07:00
parent 34555dd789
commit 37f0008ec8
21 changed files with 2028 additions and 108 deletions
@@ -304,26 +304,27 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
SpaceWidth(12),
Expanded(
child: AppElevatedButton.filled(
onPressed: () {
if (customerController.text == '') {
AppFlushbar.showError(
context,
'Pilih Pelanggan terlebih dahulu',
);
return;
}
isLoading: orderState.isCreating,
onPressed: orderState.isCreating
? null
: () {
if (customerController.text == '') {
AppFlushbar.showError(
context,
'Pilih Pelanggan terlebih dahulu',
);
return;
}
context.read<OrderFormBloc>().add(
OrderFormEvent.createOrderWithPayment(
items: widget.checkoutState.items,
orderType: widget.checkoutState.orderType,
table: widget.checkoutState.table,
),
);
},
// context.read<OrderFormBloc>().add(
// OrderFormEvent.createWithPayment(
// items: items,
// customerName: customerController.text,
// orderType: orderType,
// paymentMethod: selectedPaymentMethod!,
// table: widget.table,
// customer: selectedCustomer,
// ),
// );
},
label: 'Bayar',
),
),