fixed live card issue
This commit is contained in:
@@ -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) {
|
||||||
|
if (nextLesson == null || now.weekday == 6 || now.weekday == 7) {
|
||||||
|
currentState = LiveCardState.empty;
|
||||||
|
} else {
|
||||||
currentState = LiveCardState.morning;
|
currentState = LiveCardState.morning;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
currentState = LiveCardState.empty;
|
currentState = LiveCardState.empty;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user