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.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: [

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_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<GradeSubjectView>
title: Text("exams".i18n),
children: _tiles,
))
: const SizedBox(),
: const Empty(),
),
);

View File

@ -214,7 +214,7 @@ class HomePageState extends State<HomePage> 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<HomePage> with TickerProviderStateMixin {
LiveCardState.duringLesson ||
_liveCard.currentState ==
LiveCardState.duringBreak)
? 288.0
? 292.0
: 238.0)),
// Live Card
@ -348,10 +348,15 @@ class HomePageState extends State<HomePage> 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,

View File

@ -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<LiveCard> {
// 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<LiveCard> {
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 &&