absence page and graph fixes

This commit is contained in:
Kima 2024-05-12 19:02:56 +02:00
parent c205bc592c
commit 1a3d78a5bc
2 changed files with 27 additions and 17 deletions

View File

@ -504,7 +504,9 @@ class AbsencesPageState extends State<AbsencesPage>
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: AppColors.of(context).green, color: value1 > 0
? AppColors.of(context).green
: AppColors.of(context).text,
), ),
), ),
Text( Text(
@ -513,12 +515,14 @@ class AbsencesPageState extends State<AbsencesPage>
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
height: 1.1, height: 1.1,
color: ColorsUtils().fade( color: value1 > 0
? ColorsUtils().fade(
context, context,
AppColors.of(context).green, AppColors.of(context).green,
darkenAmount: 0.5, darkenAmount: 0.5,
lightenAmount: 0.4, lightenAmount: 0.4,
), )
: AppColors.of(context).text,
), ),
), ),
], ],
@ -535,7 +539,9 @@ class AbsencesPageState extends State<AbsencesPage>
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: AppColors.of(context).red, color: value2 > 0
? AppColors.of(context).red
: AppColors.of(context).text,
), ),
), ),
Text( Text(
@ -544,12 +550,14 @@ class AbsencesPageState extends State<AbsencesPage>
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
height: 1.1, height: 1.1,
color: ColorsUtils().fade( color: value2 > 0
? ColorsUtils().fade(
context, context,
AppColors.of(context).red, AppColors.of(context).red,
darkenAmount: 0.4, darkenAmount: 0.4,
lightenAmount: 0.2, lightenAmount: 0.2,
), )
: AppColors.of(context).text,
), ),
), ),
], ],
@ -597,8 +605,9 @@ class AbsencesPageState extends State<AbsencesPage>
children: [ children: [
Row( Row(
children: [ children: [
const Icon( Icon(
Icons.av_timer_rounded, Icons.av_timer_rounded,
color: value3 > 0 ? Colors.orange : null,
), ),
const SizedBox( const SizedBox(
width: 10.0, width: 10.0,

View File

@ -248,11 +248,12 @@ class GradeGraphState extends State<GradeGraph> {
), ),
if (ghostData.isNotEmpty && ghostSpots.isNotEmpty) if (ghostData.isNotEmpty && ghostSpots.isNotEmpty)
LineChartBarData( LineChartBarData(
preventCurveOverShooting: true, preventCurveOverShooting: false,
spots: ghostSpots, spots: ghostSpots,
isCurved: true, isCurved: true,
colors: [AppColors.of(context).text], colors: [AppColors.of(context).text],
barWidth: 8, barWidth: 6,
curveSmoothness: 0.2,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData(show: false), dotData: FlDotData(show: false),
belowBarData: BarAreaData( belowBarData: BarAreaData(