fixed live card issue

This commit is contained in:
Kima 2024-05-05 08:11:38 +02:00
parent 6d0315e4e6
commit a17600c4ea
2 changed files with 8 additions and 3 deletions

View File

@ -15,9 +15,10 @@ enum LiveCardState {
duringLesson, duringLesson,
duringBreak, duringBreak,
morning, morning,
weekendMorning,
afternoon, afternoon,
night, night,
summary summary,
} }
class LiveCardProvider extends ChangeNotifier { class LiveCardProvider extends ChangeNotifier {
@ -297,7 +298,11 @@ class LiveCardProvider extends ChangeNotifier {
} else if (now.hour >= 20) { } else if (now.hour >= 20) {
currentState = LiveCardState.night; currentState = LiveCardState.night;
} else if (now.hour >= 5 && now.hour <= 10) { } else if (now.hour >= 5 && now.hour <= 10) {
currentState = LiveCardState.morning; if (nextLesson == null || now.weekday == 6 || now.weekday == 7) {
currentState = LiveCardState.empty;
} else {
currentState = LiveCardState.morning;
}
} else { } else {
currentState = LiveCardState.empty; currentState = LiveCardState.empty;
} }

View File

@ -213,7 +213,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
// } // }
// TODO: REMOVE IN PRODUCTION BUILD!!! // TODO: REMOVE IN PRODUCTION BUILD!!!
// print(_liveCard.currentState); print(_liveCard.currentState);
// _liveCard.currentState = LiveCardState.duringLesson; // _liveCard.currentState = LiveCardState.duringLesson;
return Scaffold( return Scaffold(