From 59d5b95e88ffc66eb5fb8954f70edff7423dc3c5 Mon Sep 17 00:00:00 2001 From: Md Raju Ahmed Date: Wed, 3 Jul 2024 22:17:26 +0200 Subject: [PATCH] fix: colorblind friendly color --- .../monitor/participant_details_view.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/designer_v2/lib/features/monitor/participant_details_view.dart b/designer_v2/lib/features/monitor/participant_details_view.dart index 9761b4999..d49093ed2 100644 --- a/designer_v2/lib/features/monitor/participant_details_view.dart +++ b/designer_v2/lib/features/monitor/participant_details_view.dart @@ -19,6 +19,10 @@ class ParticipantDetailsView extends ConsumerWidget { final List interventions; final List observations; + static const Color incompleteColor = Color(0xFFD55E00); + static const Color partiallyComplete = Color(0xFF0072B2); + static const Color completeColor = Color(0xFF009E73); + @override Widget build(BuildContext context, WidgetRef ref) { final languageCode = ref.watch(localeProvider).languageCode; @@ -150,6 +154,7 @@ class ParticipantDetailsView extends ConsumerWidget { } Widget _buildSquare(int index, Set missed, int numberOfTheDay) { + return Tooltip( message: _getTooltipText( missed, @@ -161,10 +166,10 @@ class ParticipantDetailsView extends ConsumerWidget { margin: const EdgeInsets.fromLTRB(0, 0, 8, 8), decoration: BoxDecoration( color: missed.isEmpty - ? Colors.green + ? completeColor : (monitorItem.completedTasksPerDay[index].isEmpty - ? Colors.red - : Colors.orange), + ? incompleteColor + : partiallyComplete), borderRadius: BorderRadius.circular(8), ), child: Center( @@ -216,17 +221,17 @@ class ParticipantDetailsView extends ConsumerWidget { Row( children: [ _buildLegendItem( - Colors.green, + completeColor, tr.participant_details_color_legend_completed, ), const SizedBox(width: 16.0), _buildLegendItem( - Colors.orange, + partiallyComplete, tr.participant_details_color_legend_partially_completed, ), const SizedBox(width: 16.0), _buildLegendItem( - Colors.red, + incompleteColor, tr.participant_details_color_legend_missed, ), ],