Skip to content

Commit

Permalink
color design fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhattabhi013 committed Apr 9, 2022
1 parent e949e13 commit 6e01e6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class KnowledgePanelTitleCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final ColorScheme colorScheme = themeData.colorScheme;
Color? colorFromEvaluation;
if (evaluation != null &&
(knowledgePanelTitleElement.iconColorFromEvaluation ?? false)) {
Expand All @@ -27,10 +26,8 @@ class KnowledgePanelTitleCard extends StatelessWidget {
colorFromEvaluation = _getColorFromEvaluation(evaluation!);
}
}
if (evaluation != null &&
_getColorFromEvaluation(evaluation!) == null &&
themeData.brightness == Brightness.dark) {
colorFromEvaluation = colorScheme.onBackground;
if (evaluation != null && themeData.brightness == Brightness.dark) {
colorFromEvaluation = _getColorFromEvaluationDarkMode(evaluation!);
}
List<Widget> iconWidget;
if (knowledgePanelTitleElement.iconUrl != null) {
Expand Down Expand Up @@ -87,7 +84,7 @@ class KnowledgePanelTitleCard extends StatelessWidget {
);
}

Color? _getColorFromEvaluation(Evaluation evaluation) {
Color _getColorFromEvaluation(Evaluation evaluation) {
switch (evaluation) {
case Evaluation.BAD:
return RED_COLOR;
Expand All @@ -98,22 +95,22 @@ class KnowledgePanelTitleCard extends StatelessWidget {
case Evaluation.GOOD:
return LIGHT_GREEN_COLOR;
case Evaluation.UNKNOWN:
return null;
return PRIMARY_GREY_COLOR;
}
}

Color? _getColorFromEvaluationDarkMode(Evaluation evaluation) {
Color _getColorFromEvaluationDarkMode(Evaluation evaluation) {
switch (evaluation) {
case Evaluation.BAD:
return RED_COLOR;
case Evaluation.NEUTRAL:
return GREY_COLOR;
return LIGHT_GREY_COLOR;
case Evaluation.AVERAGE:
return LIGHT_ORANGE_COLOR;
case Evaluation.GOOD:
return LIGHT_GREEN_COLOR;
case Evaluation.UNKNOWN:
return null;
return LIGHT_GREY_COLOR;
}
}
}
1 change: 1 addition & 0 deletions packages/smooth_app/lib/generic_lib/design_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Color WHITE_COLOR = Color(0xFFFFFFFF);
const Color DARK_GREEN_COLOR = Color(0xFF219653);
const Color LIGHT_GREEN_COLOR = Color(0xFF60AC0E);
const Color LIGHT_YELLOW_COLOR = Color(0xFFF2C94C);
const Color LIGHT_GREY_COLOR = Color(0xFFBFBFBF);
const Color DARK_YELLOW_COLOR = Color(0xFFC88F01);
const Color LIGHT_ORANGE_COLOR = Color(0xFFF2994A);
const Color DARK_ORANGE_COLOR = Color(0xFFE07312);
Expand Down

0 comments on commit 6e01e6a

Please sign in to comment.