feat: Update Dashboard Overview to display total employees instead of absent count

This commit is contained in:
Vaibhav Surve 2025-09-27 11:30:18 +05:30
parent fd7c338c05
commit 075167e285

View File

@ -58,14 +58,13 @@ class DashboardOverviewWidgets {
final total = dashboardController.totalEmployees.value;
final inToday = dashboardController.inToday.value.clamp(0, total);
final absent = (total - inToday).clamp(0, total);
final percent = total > 0 ? inToday / total : 0.0;
final hasData = total > 0;
final data = hasData
? [
_ChartData('In Today', inToday.toDouble(), _accentA),
_ChartData('Absent', absent.toDouble(), _muted),
_ChartData('Total', total.toDouble(), _muted),
]
: [
_ChartData('No Data', 1.0, _hint),
@ -86,11 +85,11 @@ class DashboardOverviewWidgets {
footer: _SingleColumnKpis(
stats: {
"In Today": _comma.format(inToday),
"Absent": _comma.format(absent),
"Total": _comma.format(total),
},
colors: {
"In Today": _accentA,
"Absent": _muted,
"Total": _muted,
},
),
);