visual bug fixes

This commit is contained in:
Kima 2024-05-03 16:51:43 +02:00
parent 4abd16ab76
commit d5f583a0d2
4 changed files with 44 additions and 32 deletions

View File

@ -27,7 +27,7 @@ class LessonTile extends StatelessWidget {
this.currentLessonIndicator = true, this.currentLessonIndicator = true,
this.padding, this.padding,
this.contentPadding, this.contentPadding,
this.showSubTiles = false, this.showSubTiles = true,
}); });
final Lesson lesson; final Lesson lesson;
@ -151,7 +151,8 @@ class LessonTile extends StatelessWidget {
child: PanelTitle(title: Text(lesson.name)), child: PanelTitle(title: Text(lesson.name)),
), ),
child: Padding( 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( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

View File

@ -19,6 +19,7 @@ import 'package:refilc_kreta_api/models/grade.dart';
import 'package:refilc_kreta_api/models/subject.dart'; import 'package:refilc_kreta_api/models/subject.dart';
import 'package:refilc_mobile_ui/common/average_display.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/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/filter_bar.dart';
import 'package:refilc_mobile_ui/common/panel/panel.dart'; import 'package:refilc_mobile_ui/common/panel/panel.dart';
import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart'; import 'package:refilc_mobile_ui/common/splitted_panel/splitted_panel.dart';
@ -281,7 +282,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView>
title: Text("exams".i18n), title: Text("exams".i18n),
children: _tiles, children: _tiles,
)) ))
: const SizedBox(), : const Empty(),
), ),
); );

View File

@ -214,7 +214,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.duringBreak; _liveCard.currentState = LiveCardState.duringLesson;
return Scaffold( return Scaffold(
body: Stack( body: Stack(
@ -330,7 +330,7 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
LiveCardState.duringLesson || LiveCardState.duringLesson ||
_liveCard.currentState == _liveCard.currentState ==
LiveCardState.duringBreak) LiveCardState.duringBreak)
? 288.0 ? 292.0
: 238.0)), : 238.0)),
// Live Card // Live Card
@ -348,10 +348,15 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
? 0.0 ? 0.0
: 62.0) + : 62.0) +
MediaQuery.of(context).padding.top, MediaQuery.of(context).padding.top,
bottom: _liveCard.currentState == bottom: (_liveCard.currentState ==
LiveCardState.morning LiveCardState.morning)
? 44.0 ? 44.0
: 52.0, : ((_liveCard.currentState ==
LiveCardState.duringLesson ||
_liveCard.currentState ==
LiveCardState.duringBreak)
? 55.0
: 52.0),
), ),
child: Transform.scale( child: Transform.scale(
scale: _liveCardAnimation.value, scale: _liveCardAnimation.value,

View File

@ -6,6 +6,10 @@ import 'package:refilc/helpers/subject.dart';
import 'package:refilc/models/settings.dart'; import 'package:refilc/models/settings.dart';
import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc/ui/widgets/lesson/lesson_tile.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/panel/panel.dart';
import 'package:refilc_mobile_ui/common/progress_bar.dart'; import 'package:refilc_mobile_ui/common/progress_bar.dart';
import 'package:refilc_mobile_ui/common/round_border_icon.dart'; import 'package:refilc_mobile_ui/common/round_border_icon.dart';
@ -67,30 +71,30 @@ class LiveCardStateA extends State<LiveCard> {
// test // test
// TODO: REMOVE IN PRODUCTION BUILD!!! // TODO: REMOVE IN PRODUCTION BUILD!!!
// liveCard.currentState = LiveCardState.duringBreak; liveCard.currentState = LiveCardState.duringLesson;
// liveCard.nextLesson = Lesson( liveCard.currentLesson = Lesson(
// date: DateTime.now().add(Duration( date: DateTime.now().add(Duration(
// minutes: 30, minutes: 30,
// )), )),
// subject: GradeSubject( subject: GradeSubject(
// category: Category(id: 'asd'), id: 'asd', name: 'Matematika'), category: Category(id: 'asd'), id: 'asd', name: 'Matematika'),
// lessonIndex: '1', lessonIndex: '1',
// teacher: Teacher(id: 'id', name: 'name'), teacher: Teacher(id: 'id', name: 'name'),
// start: DateTime.now().subtract(Duration( start: DateTime.now().subtract(Duration(
// minutes: 30, minutes: 30,
// )), )),
// end: DateTime.now().add(Duration( end: DateTime.now().add(Duration(
// minutes: 15, minutes: 15,
// )), )),
// homeworkId: 'homeworkId', homeworkId: 'homeworkId',
// id: 'id', id: 'id',
// description: 'description', description: 'description',
// room: 'ABC69', room: 'ABC69',
// groupName: 'groupName', groupName: 'groupName',
// name: 'name', name: 'name',
// ); );
// liveCard.prevLesson = liveCard.nextLesson; liveCard.nextLesson = liveCard.currentLesson;
// final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1); // final dt = DateTime(2024, 3, 22, 17, 12, 1, 1, 1);
@ -408,8 +412,9 @@ class LiveCardStateA extends State<LiveCard> {
swapRoom: true, swapRoom: true,
currentLessonIndicator: false, currentLessonIndicator: false,
padding: padding:
const EdgeInsets.only(top: 8.0, bottom: 4.0), const EdgeInsets.only(top: 6.0, bottom: 4.0),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
showSubTiles: false,
), ),
if (!(nextSubject == null && if (!(nextSubject == null &&
progressCurrent == null && progressCurrent == null &&