Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Transportation Component Icon and title color is not compatible #1494

Merged
merged 16 commits into from
Apr 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ class KnowledgePanelTitleCard extends StatelessWidget {

final TitleElement knowledgePanelTitleElement;
final Evaluation? evaluation;

@override
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final ColorScheme colorScheme = themeData.colorScheme;
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
Color? colorFromEvaluation;
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
Color? iconColorFromEvaluation;
if (evaluation != null &&
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
(knowledgePanelTitleElement.iconColorFromEvaluation ?? false)) {
colorFromEvaluation = _getColorFromEvaluation(evaluation!);
iconColorFromEvaluation = _getColorFromEvaluation(evaluation!);
}
if (evaluation != null &&
_getColorFromEvaluation(evaluation!) == null &&
themeData.brightness == Brightness.dark) {
colorFromEvaluation = Colors.white;
iconColorFromEvaluation = colorScheme.primary;
}
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
List<Widget> iconWidget;
if (knowledgePanelTitleElement.iconUrl != null) {
Expand All @@ -37,7 +41,7 @@ class KnowledgePanelTitleCard extends StatelessWidget {
iconUrl: knowledgePanelTitleElement.iconUrl,
width: 36,
height: 36,
color: colorFromEvaluation,
color: iconColorFromEvaluation,
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
),
),
),
Expand Down Expand Up @@ -84,7 +88,7 @@ class KnowledgePanelTitleCard extends StatelessWidget {
case Evaluation.BAD:
return RED_COLOR;
case Evaluation.NEUTRAL:
return GREY_COLOR;
return PRIMARY_GREY_COLOR;
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved
case Evaluation.AVERAGE:
return LIGHT_ORANGE_COLOR;
case Evaluation.GOOD:
Expand Down