feat: Update Dashboard Overview to display total employees instead of absent count
This commit is contained in:
parent
fd7c338c05
commit
075167e285
@ -58,14 +58,13 @@ class DashboardOverviewWidgets {
|
|||||||
|
|
||||||
final total = dashboardController.totalEmployees.value;
|
final total = dashboardController.totalEmployees.value;
|
||||||
final inToday = dashboardController.inToday.value.clamp(0, total);
|
final inToday = dashboardController.inToday.value.clamp(0, total);
|
||||||
final absent = (total - inToday).clamp(0, total);
|
|
||||||
final percent = total > 0 ? inToday / total : 0.0;
|
final percent = total > 0 ? inToday / total : 0.0;
|
||||||
|
|
||||||
final hasData = total > 0;
|
final hasData = total > 0;
|
||||||
final data = hasData
|
final data = hasData
|
||||||
? [
|
? [
|
||||||
_ChartData('In Today', inToday.toDouble(), _accentA),
|
_ChartData('In Today', inToday.toDouble(), _accentA),
|
||||||
_ChartData('Absent', absent.toDouble(), _muted),
|
_ChartData('Total', total.toDouble(), _muted),
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
_ChartData('No Data', 1.0, _hint),
|
_ChartData('No Data', 1.0, _hint),
|
||||||
@ -86,11 +85,11 @@ class DashboardOverviewWidgets {
|
|||||||
footer: _SingleColumnKpis(
|
footer: _SingleColumnKpis(
|
||||||
stats: {
|
stats: {
|
||||||
"In Today": _comma.format(inToday),
|
"In Today": _comma.format(inToday),
|
||||||
"Absent": _comma.format(absent),
|
"Total": _comma.format(total),
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
"In Today": _accentA,
|
"In Today": _accentA,
|
||||||
"Absent": _muted,
|
"Total": _muted,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user