From 1a3d78a5bc32f85d4d994d4b77a922eaa6f2b3fe Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 12 May 2024 19:02:56 +0200 Subject: [PATCH] absence page and graph fixes --- .../lib/pages/absences/absences_page.dart | 39 ++++++++++++------- refilc_mobile_ui/lib/pages/grades/graph.dart | 5 ++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/refilc_mobile_ui/lib/pages/absences/absences_page.dart b/refilc_mobile_ui/lib/pages/absences/absences_page.dart index ff339db..1be6ff3 100644 --- a/refilc_mobile_ui/lib/pages/absences/absences_page.dart +++ b/refilc_mobile_ui/lib/pages/absences/absences_page.dart @@ -504,7 +504,9 @@ class AbsencesPageState extends State style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w700, - color: AppColors.of(context).green, + color: value1 > 0 + ? AppColors.of(context).green + : AppColors.of(context).text, ), ), Text( @@ -513,12 +515,14 @@ class AbsencesPageState extends State fontSize: 16.0, fontWeight: FontWeight.w500, height: 1.1, - color: ColorsUtils().fade( - context, - AppColors.of(context).green, - darkenAmount: 0.5, - lightenAmount: 0.4, - ), + color: value1 > 0 + ? ColorsUtils().fade( + context, + AppColors.of(context).green, + darkenAmount: 0.5, + lightenAmount: 0.4, + ) + : AppColors.of(context).text, ), ), ], @@ -535,7 +539,9 @@ class AbsencesPageState extends State style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w700, - color: AppColors.of(context).red, + color: value2 > 0 + ? AppColors.of(context).red + : AppColors.of(context).text, ), ), Text( @@ -544,12 +550,14 @@ class AbsencesPageState extends State fontSize: 16.0, fontWeight: FontWeight.w500, height: 1.1, - color: ColorsUtils().fade( - context, - AppColors.of(context).red, - darkenAmount: 0.4, - lightenAmount: 0.2, - ), + color: value2 > 0 + ? ColorsUtils().fade( + context, + AppColors.of(context).red, + darkenAmount: 0.4, + lightenAmount: 0.2, + ) + : AppColors.of(context).text, ), ), ], @@ -597,8 +605,9 @@ class AbsencesPageState extends State children: [ Row( children: [ - const Icon( + Icon( Icons.av_timer_rounded, + color: value3 > 0 ? Colors.orange : null, ), const SizedBox( width: 10.0, diff --git a/refilc_mobile_ui/lib/pages/grades/graph.dart b/refilc_mobile_ui/lib/pages/grades/graph.dart index ed8e2e8..a52720b 100644 --- a/refilc_mobile_ui/lib/pages/grades/graph.dart +++ b/refilc_mobile_ui/lib/pages/grades/graph.dart @@ -248,11 +248,12 @@ class GradeGraphState extends State { ), if (ghostData.isNotEmpty && ghostSpots.isNotEmpty) LineChartBarData( - preventCurveOverShooting: true, + preventCurveOverShooting: false, spots: ghostSpots, isCurved: true, colors: [AppColors.of(context).text], - barWidth: 8, + barWidth: 6, + curveSmoothness: 0.2, isStrokeCapRound: true, dotData: FlDotData(show: false), belowBarData: BarAreaData(