Skip to content

Commit

Permalink
fix: knowledge panel name made visible (#1442)
Browse files Browse the repository at this point in the history
* knowledge panel name made visible

* used const values on margin

* knowledge panel name made visible
  • Loading branch information
AshAman999 authored Apr 2, 2022
1 parent 494bfd7 commit 3b16bbe
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@ class KnowledgePanelSummaryCard extends StatelessWidget {
if (knowledgePanel.titleElement == null) {
return EMPTY_WIDGET;
}
final ThemeData themeData = Theme.of(context);
switch (knowledgePanel.titleElement!.type) {
case TitleElementType.GRADE:
return ScoreCard(
iconUrl: knowledgePanel.titleElement!.iconUrl,
description: knowledgePanel.titleElement!.title,
cardEvaluation: getCardEvaluationFromKnowledgePanelTitleElement(
knowledgePanel.titleElement!,
),
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(vertical: VERY_SMALL_SPACE),
child: Text(
knowledgePanel.topics!.first.substring(0, 1).toUpperCase() +
knowledgePanel.topics!.first.substring(1),
style: themeData.textTheme.headline3,
),
),
ScoreCard(
iconUrl: knowledgePanel.titleElement!.iconUrl,
description: knowledgePanel.titleElement!.title,
cardEvaluation: getCardEvaluationFromKnowledgePanelTitleElement(
knowledgePanel.titleElement!,
),
),
],
);
case null:
case TitleElementType.UNKNOWN:
Expand Down

0 comments on commit 3b16bbe

Please sign in to comment.