Skip to content

Commit

Permalink
added set for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bhattabhi013 committed Apr 8, 2022
1 parent f7c7a5a commit e949e13
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class KnowledgePanelTitleCard extends StatelessWidget {
Color? colorFromEvaluation;
if (evaluation != null &&
(knowledgePanelTitleElement.iconColorFromEvaluation ?? false)) {
colorFromEvaluation = _getColorFromEvaluation(evaluation!);
if (themeData.brightness == Brightness.dark) {
colorFromEvaluation = _getColorFromEvaluationDarkMode(evaluation!);
} else {
colorFromEvaluation = _getColorFromEvaluation(evaluation!);
}
}
if (evaluation != null &&
_getColorFromEvaluation(evaluation!) == null &&
Expand Down Expand Up @@ -88,7 +92,22 @@ class KnowledgePanelTitleCard extends StatelessWidget {
case Evaluation.BAD:
return RED_COLOR;
case Evaluation.NEUTRAL:
return PRIMARY_BLUE_COLOR;
return PRIMARY_GREY_COLOR;
case Evaluation.AVERAGE:
return LIGHT_ORANGE_COLOR;
case Evaluation.GOOD:
return LIGHT_GREEN_COLOR;
case Evaluation.UNKNOWN:
return null;
}
}

Color? _getColorFromEvaluationDarkMode(Evaluation evaluation) {
switch (evaluation) {
case Evaluation.BAD:
return RED_COLOR;
case Evaluation.NEUTRAL:
return GREY_COLOR;
case Evaluation.AVERAGE:
return LIGHT_ORANGE_COLOR;
case Evaluation.GOOD:
Expand Down

0 comments on commit e949e13

Please sign in to comment.