From 236c34dbe66725d6e781c319d4e832118f47f528 Mon Sep 17 00:00:00 2001 From: Kima Date: Wed, 24 Apr 2024 19:23:05 +0200 Subject: [PATCH] fixed live card bugs --- .../lib/pages/absences/absences_page.dart | 6 ++-- .../lib/pages/home/home_page.dart | 33 ++++++++++--------- .../lib/pages/home/live_card/live_card.dart | 5 +-- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/refilc_mobile_ui/lib/pages/absences/absences_page.dart b/refilc_mobile_ui/lib/pages/absences/absences_page.dart index 0daa176..6f69382 100644 --- a/refilc_mobile_ui/lib/pages/absences/absences_page.dart +++ b/refilc_mobile_ui/lib/pages/absences/absences_page.dart @@ -555,7 +555,6 @@ class AbsencesPageState extends State ), Column( children: [ - // ide kell valami csik widget diagram idk Container( height: 9.11, decoration: BoxDecoration( @@ -570,8 +569,9 @@ class AbsencesPageState extends State ), ), ), - - // es ala ez + const SizedBox( + height: 3.0, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/refilc_mobile_ui/lib/pages/home/home_page.dart b/refilc_mobile_ui/lib/pages/home/home_page.dart index 6670c77..06106d0 100644 --- a/refilc_mobile_ui/lib/pages/home/home_page.dart +++ b/refilc_mobile_ui/lib/pages/home/home_page.dart @@ -195,22 +195,22 @@ class HomePageState extends State with TickerProviderStateMixin { // ]; // String? selectedValue; - DateTime now = DateTime.now(); + // DateTime now = DateTime.now(); // 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)) && - now.isAfter(DateTime(now.year, DateTime.june, 14))) { - currentState = LiveCardState.summary; - } else if (now.hour >= 12 && now.hour < 20) { - currentState = LiveCardState.afternoon; - } else if (now.hour >= 20) { - currentState = LiveCardState.night; - } else if (now.hour >= 5 && now.hour <= 10) { - currentState = LiveCardState.morning; - } else { - currentState = LiveCardState.empty; - } + // if (now.isBefore(DateTime(now.year, DateTime.august, 31)) && + // now.isAfter(DateTime(now.year, DateTime.june, 14))) { + // currentState = LiveCardState.summary; + // } else if (now.hour >= 12 && now.hour < 20) { + // currentState = LiveCardState.afternoon; + // } else if (now.hour >= 20) { + // currentState = LiveCardState.night; + // } else if (now.hour >= 5 && now.hour <= 10) { + // currentState = LiveCardState.morning; + // } else { + // currentState = LiveCardState.empty; + // } return Scaffold( body: Stack( @@ -320,7 +320,7 @@ class HomePageState extends State with TickerProviderStateMixin { // expandedHeight: _liveCardAnimation.value * 238.0, expandedHeight: _liveCardAnimation.value * - (currentState == LiveCardState.morning + (_liveCard.currentState == LiveCardState.morning ? 280.0 : 238.0), @@ -330,7 +330,8 @@ class HomePageState extends State with TickerProviderStateMixin { padding: EdgeInsets.only( left: 24.0, right: 24.0, - top: (currentState == LiveCardState.morning + top: (_liveCard.currentState == + LiveCardState.morning ? 0.0 : 62.0) + MediaQuery.of(context).padding.top, diff --git a/refilc_mobile_ui/lib/pages/home/live_card/live_card.dart b/refilc_mobile_ui/lib/pages/home/live_card/live_card.dart index a4a3638..860ed6d 100644 --- a/refilc_mobile_ui/lib/pages/home/live_card/live_card.dart +++ b/refilc_mobile_ui/lib/pages/home/live_card/live_card.dart @@ -83,7 +83,7 @@ class LiveCardStateA extends State { // 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) { case LiveCardState.summary: @@ -217,7 +217,8 @@ class LiveCardStateA extends State { const SizedBox( height: 5.0, ), - SegmentedCountdown(date: dt) + SegmentedCountdown( + date: liveCard.nextLesson!.start), ], ), ],