fix add order item
This commit is contained in:
parent
9e4e2ebbd1
commit
6ac88b92ae
@ -70,6 +70,9 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
||||||
(order) {
|
(order) {
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
|
context.read<CheckoutFormBloc>().add(
|
||||||
|
CheckoutFormEvent.orderAddedItems(order),
|
||||||
|
);
|
||||||
context.router.replace(const SuccessAddItemOrderRoute());
|
context.router.replace(const SuccessAddItemOrderRoute());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -188,10 +188,14 @@ class SuccessAddItemOrderLeftPanel extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
print("onPressed");
|
||||||
|
print(checkoutState.orderAdded);
|
||||||
|
final order = checkoutState.orderAdded;
|
||||||
|
if (order == null) return;
|
||||||
context.read<PrintStruckBloc>().add(
|
context.read<PrintStruckBloc>().add(
|
||||||
PrintStruckEvent.order(
|
PrintStruckEvent.order(
|
||||||
Order.fromLastOrder(
|
Order.fromLastOrder(
|
||||||
checkoutState.orderAdded!,
|
order,
|
||||||
checkoutState.items,
|
checkoutState.items,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user