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

@@ -16,49 +16,55 @@ class GradeSmallCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FirkaCard(
left: [
ClassIconWidget(
uid: subject.uid,
className: subject.name,
category: subject.category.name!,
color: appStyle.colors.accent,
),
const SizedBox(width: 4),
SizedBox(
width: 200,
child: Text(
subject.name,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
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,
),
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,
color: getGradeColor(
grades.getAverageBySubject(subject),
).withAlpha(38),
child: Padding(
padding: const EdgeInsets.only(
left: 8,
right: 8,
top: 4,
bottom: 4,
grades.getAverageBySubject(subject).isNaN
? const SizedBox()
: Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(
grades.getAverageBySubject(subject),
).withAlpha(38),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(
grades.getAverageBySubject(subject).toStringAsFixed(2),
style: appStyle.fonts.B_16SB.apply(
color: getGradeColor(grades.getAverageBySubject(subject)),
child: Center(
child: Text(
grades.getAverageBySubject(subject).toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(
grades.getAverageBySubject(subject),
),
),
),
),
),
),
],
],
),
);
}
}