1
0
forked from firka/firka

fix: timetable style

This commit is contained in:
checkedear
2026-04-18 13:38:44 +02:00
parent 607f49bafc
commit 06249bfc3d
2 changed files with 68 additions and 45 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:firka/api/client/kreta_stream.dart';
import 'package:intl/intl.dart';
import 'package:kreta_api/kreta_api.dart';
import 'package:firka/core/debug_helper.dart';
import 'package:firka/core/extensions.dart';
@@ -287,7 +288,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
active = -1;
const double cardWidth = 40.0;
const double spacing = 18.0;
const double spacing = 16.0;
final double totalCardWidth = cardWidth + spacing;
// Calculate animation positions based on real display indices
@@ -409,7 +410,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
Stack(
children: [
ttWidget,
Transform.translate(offset: Offset(38, -10), child: BubbleTest()),
Transform.translate(offset: Offset(34, -9), child: BubbleTest()),
],
),
);
@@ -464,10 +465,11 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
);
}
Widget ttAnimatedCard = Card(
color: Colors.transparent,
shadowColor: Colors.transparent,
child: SizedBox(width: 40, height: 54),
Widget ttAnimatedCard = BottomTimeTableNavIconWidget(
widget.data.l10n,
() => {},
false,
null,
);
if (_cardOffsetAnimation != null && _showAnimatedCard) {
@@ -476,10 +478,11 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
builder: (context, child) {
return Transform.translate(
offset: _cardOffsetAnimation!.value,
child: Card(
color: appStyle.colors.buttonSecondaryFill,
shadowColor: Colors.transparent,
child: SizedBox(width: 40, height: 54),
child: BottomTimeTableNavIconWidget(
widget.data.l10n,
() => {},
true,
null,
),
);
},
@@ -600,6 +603,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
),
GestureDetector(
child: Row(
spacing: 4,
children: [
Text(
now!.format(
@@ -610,7 +614,6 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
color: appStyle.colors.textPrimary,
),
),
SizedBox(width: 4),
if (showABTimetable) ...[
Text(
"",
@@ -618,7 +621,6 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
color: appStyle.colors.accent,
),
),
SizedBox(width: 4),
Text(
now!.isAWeek()
? widget.data.l10n.a_week
@@ -672,6 +674,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: TransparentPointer(
@@ -701,7 +704,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
),
),
Container(
padding: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.only(bottom: 2),
decoration: ShapeDecoration(
color: Colors.transparent,
shape: RoundedRectangleBorder(
@@ -710,17 +713,18 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
shadows: [
BoxShadow(
color: appStyle.colors.background,
blurRadius: 30,
spreadRadius: 20,
offset: Offset(0, -25),
blurRadius: 36,
offset: Offset(0, -27),
),
],
),
child: Stack(
children: [
ttAnimatedCard,
Wrap(spacing: 10, children: ttWidgets),
],
child: Center(
child: Stack(
children: [
ttAnimatedCard,
Wrap(spacing: 16, children: ttWidgets),
],
),
),
),
],

View File

@@ -1,5 +1,6 @@
import 'package:firka/core/extensions.dart';
import 'package:firka/l10n/app_localizations.dart';
import 'package:firka_common/ui/components/firka_card.dart';
import 'package:flutter/material.dart';
import 'package:firka/ui/theme/style.dart';
@@ -8,7 +9,7 @@ class BottomTimeTableNavIconWidget extends StatelessWidget {
final AppLocalizations l10n;
final void Function() onTap;
final bool active;
final DateTime date;
final DateTime? date;
const BottomTimeTableNavIconWidget(
this.l10n,
@@ -25,30 +26,48 @@ class BottomTimeTableNavIconWidget extends StatelessWidget {
onTap: () {
onTap();
},
child: Card(
color: active
? appStyle.colors.buttonSecondaryFill
: Colors.transparent,
shadowColor: active ? appStyle.colors.shadowColor : Colors.transparent,
child: SizedBox(
width: 40,
height: 54,
child: Container(
width: 40,
height: 54,
decoration: ShapeDecoration(
shadows: active
? [
BoxShadow(
color: appStyle.colors.shadowColor,
offset: const Offset(0, 1),
),
]
: [],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
color: active
? appStyle.colors.buttonSecondaryFill
: Colors.transparent,
),
child: Center(
child: Column(
children: [
SizedBox(height: 6),
Text(
date.format(l10n, FormatMode.da),
style: appStyle.fonts.H_16px.apply(
color: appStyle.colors.textPrimary,
),
),
Text(
date.format(l10n, FormatMode.dd),
style: appStyle.fonts.B_16R.apply(
color: appStyle.colors.textSecondary,
),
),
],
mainAxisSize: MainAxisSize.min,
children: date != null
? [
Text(
date!.format(l10n, FormatMode.da),
style: appStyle.fonts.H_16px.apply(
color: active
? appStyle.colors.textPrimary
: appStyle.colors.textTeritary,
),
),
Text(
date!.format(l10n, FormatMode.dd),
style: appStyle.fonts.B_16R.apply(
color: active
? appStyle.colors.textSecondary
: appStyle.colors.textTeritary,
),
),
]
: [],
),
),
),