fixed live card bugs

This commit is contained in:
Kima 2024-04-24 19:23:05 +02:00
parent 02af238c1b
commit 236c34dbe6
3 changed files with 23 additions and 21 deletions

View File

@ -555,7 +555,6 @@ class AbsencesPageState extends State<AbsencesPage>
), ),
Column( Column(
children: [ children: [
// ide kell valami csik widget diagram idk
Container( Container(
height: 9.11, height: 9.11,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -570,8 +569,9 @@ class AbsencesPageState extends State<AbsencesPage>
), ),
), ),
), ),
const SizedBox(
// es ala ez height: 3.0,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,

View File

@ -195,22 +195,22 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
// ]; // ];
// String? selectedValue; // String? selectedValue;
DateTime now = DateTime.now(); // DateTime now = DateTime.now();
// DateTime now = DateTime(2024, 4, 22, 5, 55); // DateTime now = DateTime(2024, 4, 22, 5, 55);
LiveCardState currentState = LiveCardState.empty; // LiveCardState currentState = LiveCardState.empty;
if (now.isBefore(DateTime(now.year, DateTime.august, 31)) && // if (now.isBefore(DateTime(now.year, DateTime.august, 31)) &&
now.isAfter(DateTime(now.year, DateTime.june, 14))) { // now.isAfter(DateTime(now.year, DateTime.june, 14))) {
currentState = LiveCardState.summary; // currentState = LiveCardState.summary;
} else if (now.hour >= 12 && now.hour < 20) { // } else if (now.hour >= 12 && now.hour < 20) {
currentState = LiveCardState.afternoon; // currentState = LiveCardState.afternoon;
} 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; // currentState = LiveCardState.morning;
} else { // } else {
currentState = LiveCardState.empty; // currentState = LiveCardState.empty;
} // }
return Scaffold( return Scaffold(
body: Stack( body: Stack(
@ -320,7 +320,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
// expandedHeight: _liveCardAnimation.value * 238.0, // expandedHeight: _liveCardAnimation.value * 238.0,
expandedHeight: _liveCardAnimation.value * expandedHeight: _liveCardAnimation.value *
(currentState == LiveCardState.morning (_liveCard.currentState == LiveCardState.morning
? 280.0 ? 280.0
: 238.0), : 238.0),
@ -330,7 +330,8 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 24.0, left: 24.0,
right: 24.0, right: 24.0,
top: (currentState == LiveCardState.morning top: (_liveCard.currentState ==
LiveCardState.morning
? 0.0 ? 0.0
: 62.0) + : 62.0) +
MediaQuery.of(context).padding.top, MediaQuery.of(context).padding.top,

View File

@ -83,7 +83,7 @@ class LiveCardStateA extends State<LiveCard> {
// name: 'name', // name: 'name',
// ); // );
final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1); // final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1);
switch (liveCard.currentState) { switch (liveCard.currentState) {
case LiveCardState.summary: case LiveCardState.summary:
@ -217,7 +217,8 @@ class LiveCardStateA extends State<LiveCard> {
const SizedBox( const SizedBox(
height: 5.0, height: 5.0,
), ),
SegmentedCountdown(date: dt) SegmentedCountdown(
date: liveCard.nextLesson!.start),
], ],
), ),
], ],