timetable improvements

This commit is contained in:
Kima 2024-01-02 23:10:36 +01:00
parent 45bf766d1c
commit 0eabf19d23
2 changed files with 90 additions and 37 deletions

View File

@ -269,7 +269,7 @@ class LessonTile extends StatelessWidget {
// Current lesson indicator // Current lesson indicator
Transform.translate( Transform.translate(
offset: const Offset(-12.0, -2.0), offset: const Offset(-22.0, -1.0),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: fillLeading color: fillLeading

View File

@ -1,6 +1,7 @@
import 'dart:math'; import 'dart:math';
import 'package:animations/animations.dart'; import 'package:animations/animations.dart';
import 'package:filcnaplo/api/providers/update_provider.dart'; import 'package:filcnaplo/api/providers/update_provider.dart';
import 'package:filcnaplo/models/settings.dart';
import 'package:filcnaplo/utils/format.dart'; import 'package:filcnaplo/utils/format.dart';
import 'package:filcnaplo_kreta_api/client/client.dart'; import 'package:filcnaplo_kreta_api/client/client.dart';
import 'package:filcnaplo_kreta_api/models/week.dart'; import 'package:filcnaplo_kreta_api/models/week.dart';
@ -498,44 +499,81 @@ class TimetablePageState extends State<TimetablePage>
BorderRadius.circular( BorderRadius.circular(
16.0), 16.0),
), ),
child: Row(children: [ child: Row(
Container( mainAxisAlignment:
padding: MainAxisAlignment
const EdgeInsets .spaceBetween,
.symmetric( children: [
horizontal: Row(
10.0, children: [
vertical: 3.0), Container(
decoration: padding:
BoxDecoration( const EdgeInsets
borderRadius: .symmetric(
BorderRadius horizontal:
.circular( 8.0,
50.0), vertical:
color: AppColors.of( 2.5),
context) decoration:
.text BoxDecoration(
.withOpacity( borderRadius:
0.90), BorderRadius
.circular(
50.0),
color: AppColors.of(
context)
.text
.withOpacity(
0.90),
),
child: Text(
'break'.i18n,
style:
TextStyle(
color: Theme.of(
context)
.scaffoldBackgroundColor,
fontSize:
12.5,
fontWeight:
FontWeight
.w500,
height: 1.1,
),
),
),
const SizedBox(
width: 10.0,
),
Text(
'${before.end.hour}:${before.end.minute} - ${lesson.start.hour}:${lesson.start.minute}',
style:
const TextStyle(
fontSize: 12.5,
fontWeight:
FontWeight
.w500,
),
),
],
), ),
child: Text( if (DateTime.now()
'break'.i18n, .isBefore(lesson
style: TextStyle( .start) &&
DateTime.now()
.isAfter(
before.end))
Dot(
color: Theme.of( color: Theme.of(
context) context)
.scaffoldBackgroundColor, .colorScheme
fontSize: 13.0, .secondary
fontWeight: .withOpacity(
FontWeight.w500, .5),
), size: 10.0,
), )
), ],
const SizedBox( ),
width: 10.0,
),
Text(
'${before.end.hour}:${before.end.minute} - ${lesson.start.hour}:${lesson.start.minute}'),
]),
), ),
), ),
Padding( Padding(
@ -552,6 +590,21 @@ class TimetablePageState extends State<TimetablePage>
.symmetric( .symmetric(
horizontal: 6.0), horizontal: 6.0),
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [
if (Provider.of<
SettingsProvider>(
context,
listen: false)
.shadowEffect)
BoxShadow(
offset: const Offset(
0, 21),
blurRadius: 23.0,
color:
Theme.of(context)
.shadowColor,
)
],
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.background, .background,
@ -692,7 +745,7 @@ class TimetablePageState extends State<TimetablePage>
.toString(), .toString(),
style: TextStyle( style: TextStyle(
height: 1.0, height: 1.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
fontSize: 17.0, fontSize: 17.0,
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme