1
0
forked from firka/firka

fix: subject card design

This commit is contained in:
checkedear
2026-04-21 22:36:30 +02:00
parent ad9e2c6676
commit 08f691d559
2 changed files with 49 additions and 39 deletions

View File

@@ -285,7 +285,7 @@ class _HomeGradesScreen extends FirkaState<HomeGradesScreen> {
grades: gradesForCalculation,
l10n: widget.data.l10n,
),
SizedBox(height: 12),
SizedBox(height: 20),
Expanded(
child: ListView(
children: [
@@ -296,7 +296,11 @@ class _HomeGradesScreen extends FirkaState<HomeGradesScreen> {
),
),
SizedBox(height: 16),
...gradeCards,
Column(
spacing: 16,
mainAxisSize: MainAxisSize.min,
children: gradeCards,
),
SizedBox(height: 16),
Text(
widget.data.l10n.data,

View File

@@ -16,49 +16,55 @@ class GradeSmallCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FirkaCard(
left: [
return FirkaCard.single(
height: 52,
padding: EdgeInsets.symmetric(horizontal: 16),
margin: EdgeInsets.all(0),
child: Row(
spacing: 8,
children: [
ClassIconWidget(
uid: subject.uid,
className: subject.name,
category: subject.category.name!,
color: appStyle.colors.accent,
size: 20,
),
const SizedBox(width: 4),
SizedBox(
width: 200,
Expanded(
child: Text(
subject.name,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
overflow: TextOverflow.ellipsis,
),
),
],
right: [
grades.getAverageBySubject(subject).isNaN
? const SizedBox()
: Card(
shadowColor: Colors.transparent,
: Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(
grades.getAverageBySubject(subject),
).withAlpha(38),
child: Padding(
padding: const EdgeInsets.only(
left: 8,
right: 8,
top: 4,
bottom: 4,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
grades.getAverageBySubject(subject).toStringAsFixed(2),
style: appStyle.fonts.B_16SB.apply(
color: getGradeColor(grades.getAverageBySubject(subject)),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(
grades.getAverageBySubject(subject),
),
),
),
),
),
],
),
);
}
}