feat: update type and customer is required
This commit is contained in:
@@ -876,16 +876,26 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
SpaceWidth(12),
|
||||
Expanded(
|
||||
child: Button.filled(
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (dcontext) => SaveDialog(
|
||||
selectedTable: widget.table,
|
||||
customerName: customerController.text,
|
||||
items: items,
|
||||
orderType: orderType,
|
||||
customer: selectedCustomer,
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
);
|
||||
},
|
||||
label: 'Simpan',
|
||||
),
|
||||
),
|
||||
@@ -914,6 +924,15 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
child: state.maybeMap(
|
||||
orElse: () => Button.filled(
|
||||
onPressed: () {
|
||||
if (customerController.text ==
|
||||
'') {
|
||||
AppFlushbar.showError(
|
||||
context,
|
||||
'Pilih Pelanggan terlebih dahulu',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
context.read<OrderFormBloc>().add(
|
||||
OrderFormEvent.create(
|
||||
items: items,
|
||||
|
||||
Reference in New Issue
Block a user