2025-07-31 23:22:34 +07:00

117 lines
3.6 KiB
Dart

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';
import 'package:enaklo_pos/presentation/home/pages/dashboard_page.dart';
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,
),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () {},
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',
),
),
],
),
Row(
children: [
Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () {},
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}',
),
),
],
),
],
),
);
}
}