Skip to content

Commit

Permalink
fix: colorblind friendly color
Browse files Browse the repository at this point in the history
  • Loading branch information
rajuAhmed1705 committed Jul 3, 2024
1 parent f8627f5 commit 59d5b95
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions designer_v2/lib/features/monitor/participant_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class ParticipantDetailsView extends ConsumerWidget {
final List<Intervention> interventions;
final List<Observation> 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;
Expand Down Expand Up @@ -150,6 +154,7 @@ class ParticipantDetailsView extends ConsumerWidget {
}

Widget _buildSquare(int index, Set<String> missed, int numberOfTheDay) {

return Tooltip(
message: _getTooltipText(
missed,
Expand All @@ -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(
Expand Down Expand Up @@ -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,
),
],
Expand Down

0 comments on commit 59d5b95

Please sign in to comment.