From 3b16bbedcc9ae4955051629c0869bbf7c297a53b Mon Sep 17 00:00:00 2001 From: Aman Raj <57723319+AshAman999@users.noreply.github.com> Date: Sat, 2 Apr 2022 15:27:47 +0530 Subject: [PATCH] fix: knowledge panel name made visible (#1442) * knowledge panel name made visible * used const values on margin * knowledge panel name made visible --- .../knowledge_panel_summary_card.dart | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_summary_card.dart b/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_summary_card.dart index afab4e911f9..42d72dc98e4 100644 --- a/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_summary_card.dart +++ b/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_summary_card.dart @@ -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: [ + 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: