fix add order item

This commit is contained in:
Efril 2026-04-26 22:27:44 +07:00
parent 9e4e2ebbd1
commit 6ac88b92ae
2 changed files with 8 additions and 1 deletions

View File

@ -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());
} }
}, },

View File

@ -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,
), ),
), ),