Skip to content

Commit

Permalink
feat(app): put more focus on guideline
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Nov 28, 2024
1 parent 699c60d commit 943f2d0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 26 deletions.
53 changes: 30 additions & 23 deletions app/lib/drug/widgets/annotation_cards/drug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,37 @@ class DrugAnnotationCards extends StatelessWidget {
)
),
SizedBox(height: PharMeTheme.smallSpace),
SubHeader(context.l10n.drugs_page_header_drug),
SizedBox(height: PharMeTheme.smallSpace),
RoundedCard(
innerPadding: EdgeInsets.all(PharMeTheme.mediumSpace),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(drug.annotations.indication),
SizedBox(height: PharMeTheme.smallSpace),
buildTable([
TableRowDefinition(
context.l10n.drugs_page_header_drugclass,
drug.annotations.drugclass,
),
if (drug.annotations.brandNames.isNotEmpty)
TableRowDefinition(
context.l10n.drug_item_brand_names,
drug.annotations.brandNames.join(', '),
),
]),
],
PrettyExpansionTile(
title: SubHeader(context.l10n.drugs_page_header_drug),
visualDensity: VisualDensity.compact,
titlePadding: EdgeInsets.zero,
childrenPadding: EdgeInsets.zero,
children: [
SizedBox(height: PharMeTheme.smallSpace),
RoundedCard(
innerPadding: EdgeInsets.all(PharMeTheme.mediumSpace),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(drug.annotations.indication),
SizedBox(height: PharMeTheme.smallSpace),
buildTable([
TableRowDefinition(
context.l10n.drugs_page_header_drugclass,
drug.annotations.drugclass,
),
if (drug.annotations.brandNames.isNotEmpty)
TableRowDefinition(
context.l10n.drug_item_brand_names,
drug.annotations.brandNames.join(', '),
),
]),
],
),
),
),
),
],
),
],
);
Expand Down
22 changes: 19 additions & 3 deletions app/lib/drug/widgets/annotation_cards/guideline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,20 @@ class GuidelineAnnotationCard extends StatelessWidget {
SizedBox(height: PharMeTheme.smallToMediumSpace),
Text.rich(
TextSpan(
text:
implicationText ?? context.l10n.drugs_page_no_guidelines_text,
children: [
TextSpan(
text: context.l10n.drugs_page_implication_description,
),
TextSpan(text: '\n'),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.2)),
TextSpan(
text:
implicationText ?? context.l10n.drugs_page_no_guidelines_text,
style: implicationText != null
? TextStyle(fontWeight: FontWeight.bold)
: TextStyle(fontStyle: FontStyle.italic)
),
],
),
),
if (recommendationText != null) ...[
Expand All @@ -86,9 +98,13 @@ class GuidelineAnnotationCard extends StatelessWidget {
TextSpan(children: [
TextSpan(
text: context.l10n.drugs_page_recommendation_description,
),
TextSpan(text: '\n'),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.2)),
TextSpan(
text: recommendationText,
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(text: recommendationText),
]),
),
],
Expand Down
2 changes: 2 additions & 0 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@
},
"drugs_page_tooltip_guideline_missing": "Guidelines provide recommendations on which medications to use based on your DNA. However, no guideline is present in this case (yet).",
"@drugs_page_tooltip_guideline_missing": {},
"drugs_page_implication_description": "What your result means: ",
"@drugs_page_implication_description": {},
"drugs_page_recommendation_description": "What to do: ",
"@drugs_page_recommendation_description": {},

Expand Down

0 comments on commit 943f2d0

Please sign in to comment.