Skip to content

Commit

Permalink
knowledge panel name made visible
Browse files Browse the repository at this point in the history
  • Loading branch information
AshAman999 committed Apr 1, 2022
1 parent d820200 commit b4f37fc
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: 5.0),
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 b4f37fc

Please sign in to comment.