print bill

This commit is contained in:
efrilm
2025-11-07 16:59:46 +07:00
parent 0886e8c912
commit d78b6165c2
7 changed files with 83 additions and 69 deletions
@@ -4,8 +4,10 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../application/order/order_loader/order_loader_bloc.dart';
import '../../../application/printer/print_struck/print_struck_bloc.dart';
import '../../../common/theme/theme.dart';
import '../../../injection.dart';
import '../../components/toast/flushbar.dart';
import 'widgets/order_left_panel.dart';
import 'widgets/order_right_panel.dart';
@@ -36,6 +38,20 @@ class OrderPage extends StatelessWidget implements AutoRouteWrapper {
);
},
),
BlocListener<PrintStruckBloc, PrintStruckState>(
listenWhen: (previous, current) =>
previous.failureOrPrintStruck != current.failureOrPrintStruck,
listener: (context, state) {
state.failureOrPrintStruck.fold(() {}, (either) {
either.fold(
(f) => AppFlushbar.showPrinterFailureToast(context, f),
(success) {
AppFlushbar.showSuccess(context, "Struck berhasil dicetak");
},
);
});
},
),
],
child: SafeArea(
child: Scaffold(