diff --git a/refilc/lib/ui/widgets/lesson/lesson_tile.dart b/refilc/lib/ui/widgets/lesson/lesson_tile.dart index 43a494b..5dbbdaf 100644 --- a/refilc/lib/ui/widgets/lesson/lesson_tile.dart +++ b/refilc/lib/ui/widgets/lesson/lesson_tile.dart @@ -27,7 +27,7 @@ class LessonTile extends StatelessWidget { this.currentLessonIndicator = true, this.padding, this.contentPadding, - this.showSubTiles = false, + this.showSubTiles = true, }); final Lesson lesson; @@ -151,7 +151,8 @@ class LessonTile extends StatelessWidget { child: PanelTitle(title: Text(lesson.name)), ), child: Padding( - padding: EdgeInsets.only(bottom: subtiles.isEmpty ? 0.0 : 12.0), + padding: EdgeInsets.only( + bottom: (subtiles.isNotEmpty && showSubTiles) ? 12.0 : 0.0), child: Column( mainAxisSize: MainAxisSize.min, children: [ diff --git a/refilc_mobile_ui/lib/pages/grades/grade_subject_view.dart b/refilc_mobile_ui/lib/pages/grades/grade_subject_view.dart index 0bb1df2..bc321e0 100644 --- a/refilc_mobile_ui/lib/pages/grades/grade_subject_view.dart +++ b/refilc_mobile_ui/lib/pages/grades/grade_subject_view.dart @@ -19,6 +19,7 @@ import 'package:refilc_kreta_api/models/grade.dart'; import 'package:refilc_kreta_api/models/subject.dart'; import 'package:refilc_mobile_ui/common/average_display.dart'; import 'package:refilc_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart'; +import 'package:refilc_mobile_ui/common/empty.dart'; import 'package:refilc_mobile_ui/common/filter_bar.dart'; import 'package:refilc_mobile_ui/common/panel/panel.dart'; import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart'; @@ -281,7 +282,7 @@ class _GradeSubjectViewState extends State title: Text("exams".i18n), children: _tiles, )) - : const SizedBox(), + : const Empty(), ), ); diff --git a/refilc_mobile_ui/lib/pages/home/home_page.dart b/refilc_mobile_ui/lib/pages/home/home_page.dart index 449e521..8939275 100644 --- a/refilc_mobile_ui/lib/pages/home/home_page.dart +++ b/refilc_mobile_ui/lib/pages/home/home_page.dart @@ -214,7 +214,7 @@ class HomePageState extends State with TickerProviderStateMixin { // TODO: REMOVE IN PRODUCTION BUILD!!! // print(_liveCard.currentState); - // _liveCard.currentState = LiveCardState.duringBreak; + _liveCard.currentState = LiveCardState.duringLesson; return Scaffold( body: Stack( @@ -330,7 +330,7 @@ class HomePageState extends State with TickerProviderStateMixin { LiveCardState.duringLesson || _liveCard.currentState == LiveCardState.duringBreak) - ? 288.0 + ? 292.0 : 238.0)), // Live Card @@ -348,10 +348,15 @@ class HomePageState extends State with TickerProviderStateMixin { ? 0.0 : 62.0) + MediaQuery.of(context).padding.top, - bottom: _liveCard.currentState == - LiveCardState.morning + bottom: (_liveCard.currentState == + LiveCardState.morning) ? 44.0 - : 52.0, + : ((_liveCard.currentState == + LiveCardState.duringLesson || + _liveCard.currentState == + LiveCardState.duringBreak) + ? 55.0 + : 52.0), ), child: Transform.scale( scale: _liveCardAnimation.value, 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 d6dbcf5..e693e73 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 @@ -6,6 +6,10 @@ import 'package:refilc/helpers/subject.dart'; import 'package:refilc/models/settings.dart'; import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/ui/widgets/lesson/lesson_tile.dart'; +import 'package:refilc_kreta_api/models/category.dart'; +import 'package:refilc_kreta_api/models/lesson.dart'; +import 'package:refilc_kreta_api/models/subject.dart'; +import 'package:refilc_kreta_api/models/teacher.dart'; import 'package:refilc_mobile_ui/common/panel/panel.dart'; import 'package:refilc_mobile_ui/common/progress_bar.dart'; import 'package:refilc_mobile_ui/common/round_border_icon.dart'; @@ -67,30 +71,30 @@ class LiveCardStateA extends State { // test // TODO: REMOVE IN PRODUCTION BUILD!!! - // liveCard.currentState = LiveCardState.duringBreak; - // liveCard.nextLesson = Lesson( - // date: DateTime.now().add(Duration( - // minutes: 30, - // )), - // subject: GradeSubject( - // category: Category(id: 'asd'), id: 'asd', name: 'Matematika'), - // lessonIndex: '1', - // teacher: Teacher(id: 'id', name: 'name'), - // start: DateTime.now().subtract(Duration( - // minutes: 30, - // )), - // end: DateTime.now().add(Duration( - // minutes: 15, - // )), - // homeworkId: 'homeworkId', - // id: 'id', - // description: 'description', - // room: 'ABC69', - // groupName: 'groupName', - // name: 'name', - // ); + liveCard.currentState = LiveCardState.duringLesson; + liveCard.currentLesson = Lesson( + date: DateTime.now().add(Duration( + minutes: 30, + )), + subject: GradeSubject( + category: Category(id: 'asd'), id: 'asd', name: 'Matematika'), + lessonIndex: '1', + teacher: Teacher(id: 'id', name: 'name'), + start: DateTime.now().subtract(Duration( + minutes: 30, + )), + end: DateTime.now().add(Duration( + minutes: 15, + )), + homeworkId: 'homeworkId', + id: 'id', + description: 'description', + room: 'ABC69', + groupName: 'groupName', + name: 'name', + ); - // liveCard.prevLesson = liveCard.nextLesson; + liveCard.nextLesson = liveCard.currentLesson; // final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1); @@ -408,8 +412,9 @@ class LiveCardStateA extends State { swapRoom: true, currentLessonIndicator: false, padding: - const EdgeInsets.only(top: 8.0, bottom: 4.0), + const EdgeInsets.only(top: 6.0, bottom: 4.0), contentPadding: EdgeInsets.zero, + showSubTiles: false, ), if (!(nextSubject == null && progressCurrent == null &&