Added My Schedule tab in attendance screen

Allow 1 Day, Whole Week and Date Range swapping
This commit is contained in:
2026-03-22 11:52:25 +08:00
parent ba155885c0
commit 049ab2c794
17 changed files with 2515 additions and 305 deletions
+24 -7
View File
@@ -104,20 +104,37 @@ class _PassSlipCountdownBannerState
return widget.child;
}
final isUrgent = !_exceeded && _remaining.inMinutes < 5;
final bgColor = _exceeded || isUrgent
? Theme.of(context).colorScheme.errorContainer
: Theme.of(context).colorScheme.tertiaryContainer;
final fgColor = _exceeded || isUrgent
? Theme.of(context).colorScheme.onErrorContainer
: Theme.of(context).colorScheme.onTertiaryContainer;
final now = DateTime.now();
final hasStarted = now.isAfter(activeSlip.slipStart!) ||
now.isAtSameMomentAs(activeSlip.slipStart!);
final bool isUrgent;
final Color bgColor;
final Color fgColor;
final String message;
final IconData icon;
if (_exceeded) {
isUrgent = true;
bgColor = Theme.of(context).colorScheme.errorContainer;
fgColor = Theme.of(context).colorScheme.onErrorContainer;
message = 'Pass slip time EXCEEDED — Please return and complete it';
icon = Icons.warning_amber_rounded;
} else if (!hasStarted) {
isUrgent = false;
bgColor = Theme.of(context).colorScheme.primaryContainer;
fgColor = Theme.of(context).colorScheme.onPrimaryContainer;
final untilStart = activeSlip.slipStart!.difference(now);
message = 'Pass slip starts in ${_formatDuration(untilStart)}';
icon = Icons.schedule_rounded;
} else {
isUrgent = !_exceeded && _remaining.inMinutes < 5;
bgColor = isUrgent
? Theme.of(context).colorScheme.errorContainer
: Theme.of(context).colorScheme.tertiaryContainer;
fgColor = isUrgent
? Theme.of(context).colorScheme.onErrorContainer
: Theme.of(context).colorScheme.onTertiaryContainer;
message = 'Pass slip expires in ${_formatDuration(_remaining)}';
icon = Icons.directions_walk_rounded;
}