feat: update dashboard

This commit is contained in:
efrilm 2025-08-07 15:47:38 +07:00
parent 5a260ca3a1
commit fbd59964c3
5 changed files with 146 additions and 151 deletions

10
assets/icons/people.svg Normal file
View File

@ -0,0 +1,10 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_17_4760)">
<path d="M9 13.75C6.66 13.75 2 14.92 2 17.25V19H16V17.25C16 14.92 11.34 13.75 9 13.75ZM4.34 17C5.18 16.42 7.21 15.75 9 15.75C10.79 15.75 12.82 16.42 13.66 17H4.34ZM9 12C10.93 12 12.5 10.43 12.5 8.5C12.5 6.57 10.93 5 9 5C7.07 5 5.5 6.57 5.5 8.5C5.5 10.43 7.07 12 9 12ZM9 7C9.83 7 10.5 7.67 10.5 8.5C10.5 9.33 9.83 10 9 10C8.17 10 7.5 9.33 7.5 8.5C7.5 7.67 8.17 7 9 7ZM16.04 13.81C17.2 14.65 18 15.77 18 17.25V19H22V17.25C22 15.23 18.5 14.08 16.04 13.81ZM15 12C16.93 12 18.5 10.43 18.5 8.5C18.5 6.57 16.93 5 15 5C14.46 5 13.96 5.13 13.5 5.35C14.13 6.24 14.5 7.33 14.5 8.5C14.5 9.67 14.13 10.76 13.5 11.65C13.96 11.87 14.46 12 15 12Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_17_4760">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 892 B

View File

@ -101,6 +101,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/payments.svg
SvgGenImage get payments => const SvgGenImage('assets/icons/payments.svg');
/// File path: assets/icons/people.svg
SvgGenImage get people => const SvgGenImage('assets/icons/people.svg');
/// File path: assets/icons/print.svg
SvgGenImage get print => const SvgGenImage('assets/icons/print.svg');
@ -152,6 +155,7 @@ class $AssetsIconsGen {
orders,
pajak,
payments,
people,
print,
qrCode,
report,

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'dart:developer';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:enaklo_pos/presentation/customer/pages/customer_page.dart';
import 'package:enaklo_pos/presentation/setting/pages/setting_page.dart';
import 'package:enaklo_pos/presentation/table/pages/table_page.dart';
import 'package:flutter/material.dart';
@ -15,7 +16,6 @@ import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart';
import 'package:enaklo_pos/presentation/auth/login_page.dart';
import 'package:enaklo_pos/presentation/report/pages/report_page.dart';
import 'package:enaklo_pos/presentation/setting/bloc/sync_order/sync_order_bloc.dart';
import 'package:enaklo_pos/presentation/setting/pages/printer_configuration_page.dart';
import '../../../core/assets/assets.gen.dart';
import '../../auth/bloc/logout/logout_bloc.dart';
@ -59,8 +59,7 @@ class _DashboardPageState extends State<DashboardPage> {
),
const TablePage(),
const ReportPage(),
const PrinterConfigurationPage(),
// SalesPage(),
const CustomerPage(),
const SettingPage(),
];
// ignore: unused_local_variable
@ -121,7 +120,7 @@ class _DashboardPageState extends State<DashboardPage> {
onTap: () => _onItemTapped(2),
),
NavItem(
iconPath: Assets.icons.print.path,
iconPath: Assets.icons.people.path,
isActive: _selectedIndex == 3,
onTap: () => _onItemTapped(3),
),

View File

@ -3,7 +3,6 @@ import 'package:enaklo_pos/core/constants/colors.dart';
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
import 'package:enaklo_pos/core/extensions/string_ext.dart';
import 'package:enaklo_pos/data/models/response/table_model.dart';
import 'package:enaklo_pos/presentation/customer/pages/customer_page.dart';
import 'package:enaklo_pos/presentation/home/bloc/checkout/checkout_bloc.dart';
import 'package:enaklo_pos/presentation/home/dialog/delivery_dialog.dart';
import 'package:enaklo_pos/presentation/home/dialog/type_dialog.dart';
@ -20,7 +19,7 @@ class HomeRightTitle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: context.deviceHeight * 0.15,
height: context.deviceHeight * 0.12,
decoration: BoxDecoration(
color: AppColors.primary,
border: Border(
@ -33,52 +32,77 @@ class HomeRightTitle extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () => context.push(SalesPage(
status: 'pending',
)),
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
icon: Icon(
Icons.list,
color: Colors.white,
size: 24,
Expanded(
child: Row(
children: [
Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () => context.push(SalesPage(
status: 'pending',
)),
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
icon: Icon(
Icons.list,
color: Colors.white,
size: 24,
),
label: 'Daftar Pesanan',
),
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(CustomerPage());
}
},
label: 'Pelanggan',
),
),
],
],
),
),
Row(
children: [
Expanded(
child: BlocBuilder<CheckoutBloc, CheckoutState>(
Expanded(
child: Row(
children: [
Expanded(
child: BlocBuilder<CheckoutBloc, CheckoutState>(
builder: (context, state) {
return state.maybeWhen(
orElse: () => const SizedBox.shrink(),
loaded: (
items,
discountModel,
discount,
discountAmount,
tax,
serviceCharge,
totalQuantity,
totalPrice,
draftName,
orderType,
deliveryType,
) {
return Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () {
showDialog(
context: context,
builder: (context) {
return TypeDialog();
});
},
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
icon: Icon(
Icons.dinner_dining_outlined,
color: Colors.white,
size: 24,
),
label: orderType.value.toTitleCase(),
);
},
);
},
),
),
BlocBuilder<CheckoutBloc, CheckoutState>(
builder: (context, state) {
return state.maybeWhen(
orElse: () => const SizedBox.shrink(),
@ -95,109 +119,68 @@ class HomeRightTitle extends StatelessWidget {
orderType,
deliveryType,
) {
return Button.filled(
width: 180.0,
height: 40,
elevation: 0,
onPressed: () {
showDialog(
context: context,
builder: (context) {
return TypeDialog();
});
},
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
icon: Icon(
Icons.dinner_dining_outlined,
color: Colors.white,
size: 24,
),
label: orderType.value.toTitleCase(),
);
switch (orderType) {
case OrderType.dineIn:
return 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!.tableName}',
),
);
case OrderType.takeAway:
return const SizedBox.shrink();
case OrderType.delivery:
return Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
icon: Icon(
Icons.motorcycle_outlined,
color: Colors.white,
size: 24,
),
onPressed: () {
showDialog(
context: context,
builder: (context) {
return DeliveryDialog();
});
},
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
label: deliveryType == null
? 'Pilih Pengiriman'
: deliveryType.name,
),
);
default:
return const SizedBox.shrink();
}
},
);
},
),
),
BlocBuilder<CheckoutBloc, CheckoutState>(
builder: (context, state) {
return state.maybeWhen(
orElse: () => const SizedBox.shrink(),
loaded: (
items,
discountModel,
discount,
discountAmount,
tax,
serviceCharge,
totalQuantity,
totalPrice,
draftName,
orderType,
deliveryType,
) {
switch (orderType) {
case OrderType.dineIn:
return 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!.tableName}',
),
);
case OrderType.takeAway:
return const SizedBox.shrink();
case OrderType.delivery:
return Expanded(
child: Button.filled(
width: 180.0,
height: 40,
elevation: 0,
icon: Icon(
Icons.motorcycle_outlined,
color: Colors.white,
size: 24,
),
onPressed: () {
showDialog(
context: context,
builder: (context) {
return DeliveryDialog();
});
},
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
label: deliveryType == null
? 'Pilih Pengiriman'
: deliveryType.name,
),
);
default:
return const SizedBox.shrink();
}
},
);
},
),
],
],
),
),
],
),

View File

@ -512,12 +512,11 @@ class _$SuccessImpl implements _Success {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SuccessImpl &&
const DeepCollectionEquality().equals(other.printer, printer));
(identical(other.printer, printer) || other.printer == printer));
}
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(printer));
int get hashCode => Object.hash(runtimeType, printer);
/// Create a copy of GetPrinterTicketState
/// with the given fields replaced by the non-null parameter values.