2025-07-31 19:25:45 +07:00
|
|
|
import 'package:enaklo_pos/core/components/buttons.dart';
|
|
|
|
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
|
|
|
|
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
|
|
|
|
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
2025-08-01 01:17:00 +07:00
|
|
|
import 'package:enaklo_pos/presentation/home/dialog/type_dialog.dart';
|
2025-07-31 19:25:45 +07:00
|
|
|
import 'package:enaklo_pos/presentation/home/pages/dashboard_page.dart';
|
2025-08-02 10:50:48 +07:00
|
|
|
import 'package:enaklo_pos/presentation/sales/pages/sales_page.dart';
|
2025-07-31 19:25:45 +07:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class HomeRightTitle extends StatelessWidget {
|
|
|
|
|
final TableModel? table;
|
|
|
|
|
const HomeRightTitle({super.key, this.table});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: context.deviceHeight * 0.1,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColors.primary,
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2025-07-31 23:22:34 +07:00
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
2025-07-31 19:25:45 +07:00
|
|
|
children: [
|
2025-07-31 23:22:34 +07:00
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Button.filled(
|
|
|
|
|
width: 180.0,
|
|
|
|
|
height: 40,
|
|
|
|
|
elevation: 0,
|
2025-08-02 10:50:48 +07:00
|
|
|
onPressed: () => context.push(SalesPage()),
|
2025-07-31 23:22:34 +07:00
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.list,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
label: 'Daftar Pesanan',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Button.filled(
|
|
|
|
|
width: 180.0,
|
|
|
|
|
height: 40,
|
|
|
|
|
elevation: 0,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.person_outline,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (table == null) {
|
|
|
|
|
context.push(DashboardPage(
|
|
|
|
|
index: 1,
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
label: 'Pelanggan',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-07-31 19:25:45 +07:00
|
|
|
),
|
2025-07-31 23:22:34 +07:00
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Button.filled(
|
|
|
|
|
width: 180.0,
|
|
|
|
|
height: 40,
|
|
|
|
|
elevation: 0,
|
2025-08-01 01:17:00 +07:00
|
|
|
onPressed: () {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return TypeDialog();
|
|
|
|
|
});
|
|
|
|
|
},
|
2025-07-31 23:22:34 +07:00
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.dinner_dining_outlined,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
label: 'Dine In',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Button.filled(
|
|
|
|
|
width: 180.0,
|
|
|
|
|
height: 40,
|
|
|
|
|
elevation: 0,
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.table_restaurant_outlined,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (table == null) {
|
|
|
|
|
context.push(DashboardPage(
|
|
|
|
|
index: 1,
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
label: table == null ? 'Pilih Meja' : '${table!.id}',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-07-31 19:25:45 +07:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|