printer receipt

This commit is contained in:
efrilm
2025-11-04 22:13:15 +07:00
parent a87b62ca9f
commit 1b24bae23a
32 changed files with 4177 additions and 75 deletions
@@ -12,6 +12,7 @@ class PrinterBluetoothDialog extends StatefulWidget {
class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
@override
void initState() {
loadPermissionBluetooth();
context.read<BluetoothLoaderBloc>().add(BluetoothLoaderEvent.fetched());
super.initState();
}
@@ -38,33 +39,42 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
mainAxisAlignment: MainAxisAlignment.start,
children: state.bluetoothDevices
.map(
(item) => Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 12),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: AppColor.border, width: 1),
(item) => GestureDetector(
onTap: () {
context.read<BluetoothConnectBloc>().add(
BluetoothConnectEvent.connect(item.macAdress),
);
widget.onSelected(item.macAdress);
context.router.maybePop();
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 12),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: AppColor.border, width: 1),
),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
item.name,
style: AppStyle.lg.copyWith(
fontWeight: FontWeight.w600,
color: AppColor.primary,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
item.name,
style: AppStyle.lg.copyWith(
fontWeight: FontWeight.w600,
color: AppColor.primary,
),
),
),
SpaceHeight(4),
Text(
item.macAdress,
style: AppStyle.sm.copyWith(
color: AppColor.textSecondary,
SpaceHeight(4),
Text(
item.macAdress,
style: AppStyle.sm.copyWith(
color: AppColor.textSecondary,
),
),
),
],
],
),
),
),
)