forked from firka/student-legacy
fixed live card issue
This commit is contained in:
parent
6d0315e4e6
commit
a17600c4ea
@ -15,9 +15,10 @@ enum LiveCardState {
|
||||
duringLesson,
|
||||
duringBreak,
|
||||
morning,
|
||||
weekendMorning,
|
||||
afternoon,
|
||||
night,
|
||||
summary
|
||||
summary,
|
||||
}
|
||||
|
||||
class LiveCardProvider extends ChangeNotifier {
|
||||
@ -297,7 +298,11 @@ class LiveCardProvider extends ChangeNotifier {
|
||||
} else if (now.hour >= 20) {
|
||||
currentState = LiveCardState.night;
|
||||
} 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 {
|
||||
currentState = LiveCardState.empty;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
// }
|
||||
|
||||
// TODO: REMOVE IN PRODUCTION BUILD!!!
|
||||
// print(_liveCard.currentState);
|
||||
print(_liveCard.currentState);
|
||||
// _liveCard.currentState = LiveCardState.duringLesson;
|
||||
|
||||
return Scaffold(
|
||||
|
Loading…
x
Reference in New Issue
Block a user