save order pay later page

This commit is contained in:
efrilm
2025-10-28 16:26:35 +07:00
parent a6e58a8cc0
commit a514a8abdb
5 changed files with 447 additions and 47 deletions
@@ -1,14 +1,16 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../application/checkout/checkout_form/checkout_form_bloc.dart';
import '../../../../application/order/order_form/order_form_bloc.dart';
import '../../../../application/payment_method/payment_method_loader/payment_method_loader_bloc.dart';
import '../../../../application/table/table_loader/table_loader_bloc.dart';
import '../../../../common/extension/extension.dart';
import '../../../../common/theme/theme.dart';
import '../../../components/button/button.dart';
import '../../../components/card/payment_card.dart';
import '../../../components/dialog/order/order_save_dialog.dart';
import '../../../components/error/payment_method_error_state_widget.dart';
import '../../../components/field/field.dart';
import '../../../components/loader/loader_with_text.dart';
@@ -276,36 +278,37 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
),
SpaceWidth(12),
Expanded(
child: AppElevatedButton.filled(
onPressed: () {
if (customerController.text == '') {
AppFlushbar.showError(
context,
'Pilih Pelanggan terlebih dahulu',
);
return;
}
child: BlocBuilder<TableLoaderBloc, TableLoaderState>(
builder: (context, tableState) {
return AppElevatedButton.filled(
isLoading: tableState.isFetching,
onPressed: () {
if (customerController.text == '') {
AppFlushbar.showError(
context,
'Pilih Pelanggan terlebih dahulu',
);
return;
}
// showDialog(
// context: context,
// builder: (dcontext) => SaveDialog(
// selectedTable: widget.table,
// customerName: customerController.text,
// items: items,
// orderType: orderType,
// customer: selectedCustomer,
// deliveryModel: delivery,
// ),
// );
showDialog(
context: context,
builder: (dcontext) => OrderSaveDialog(
checkoutState: widget.checkoutState,
tables: tableState.tables,
),
);
},
label: 'Simpan',
);
},
label: 'Simpan',
),
),
SpaceWidth(12),
Expanded(
child: AppElevatedButton.filled(
isLoading: orderState.isCreating,
onPressed: orderState.isCreating
isLoading: orderState.isCreatingWithPayment,
onPressed: orderState.isCreatingWithPayment
? null
: () {
if (customerController.text == '') {