feat(dashboard): show document status distribution count over total requirements
This commit is contained in:
1 parent
e3452099cd
commit
fa0df9ed40
4 files changed
+29
-10
No files matched your search
+5
-2
@@ -456,11 +456,14 @@ Files backup/restore - mirror mode or zip -->
|
||||
<!-- # STUDENT SCREEN
|
||||
- table dropdowns only status have dropdown, other convert to icon click to change the sorting order -->
|
||||
|
||||
# REPORT SCREEN
|
||||
<!-- # REPORT SCREEN
|
||||
- deped transparency board -> remove the access and equity -> change the enrollment by sex & year to data on enrollment which compares the previous year students count and active year students count, difference, and remarks if increasing or decreasing, separate the jhs and shs
|
||||
|
||||
# USER MANAGEMENT
|
||||
- make the admin side that resets user password send into their email the link to reset password add expiration time -> then push notif the admin that successful or not that email link, if not successful or the time has expired send notif to admin, if successfull push notif the user and admin
|
||||
- make the admin side that resets user password send into their email the link to reset password add expiration time -> then push notif the admin that successful or not that email link, if not successful or the time has expired send notif to admin, if successfull push notif the user and admin -->
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -216,11 +216,17 @@ class ActivityByDayEntry {
|
||||
class StatusDistributionEntry {
|
||||
final String status;
|
||||
final int count;
|
||||
const StatusDistributionEntry({required this.status, required this.count});
|
||||
final int total;
|
||||
const StatusDistributionEntry({
|
||||
required this.status,
|
||||
required this.count,
|
||||
this.total = 0,
|
||||
});
|
||||
factory StatusDistributionEntry.fromJson(Map<String, dynamic> j) =>
|
||||
StatusDistributionEntry(
|
||||
status: j['status'] as String? ?? '',
|
||||
count: (j['count'] as num?)?.toInt() ?? 0,
|
||||
total: (j['total'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -620,8 +620,12 @@ class _StatusDistributionCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
...entries.map((e) {
|
||||
final pct = total == 0 ? 0.0 : e.count / total;
|
||||
final targetTotal = e.total > 0 ? e.total : total;
|
||||
final pct = targetTotal == 0 ? 0.0 : (e.count / targetTotal).clamp(0.0, 1.0);
|
||||
final color = _colorMap[e.status] ?? (isDark ? Colors.grey.shade400 : Colors.grey.shade500);
|
||||
final countLabel = e.total > 0
|
||||
? '${e.count}/${e.total} (${(pct * 100).toStringAsFixed(1)}%)'
|
||||
: '${e.count} (${(pct * 100).toStringAsFixed(1)}%)';
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: Column(
|
||||
@@ -639,7 +643,7 @@ class _StatusDistributionCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${e.count} (${(pct * 100).toStringAsFixed(1)}%)',
|
||||
countLabel,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
@@ -683,7 +687,9 @@ class _StatusDistributionCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'$total',
|
||||
entries.any((e) => e.total > 0)
|
||||
? '$total/${entries.firstWhere((e) => e.total > 0).total}'
|
||||
: '$total',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
Reference in new issue
Block a user