Skip to content

Commit

Permalink
feat(app): clarify that guideline is based on genes
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Feb 21, 2025
1 parent f011b78 commit 02170b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
22 changes: 17 additions & 5 deletions app/lib/drug/widgets/annotation_cards/guideline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class GuidelineAnnotationCard extends StatelessWidget {
Widget _buildResultSection(BuildContext context) {
final implicationText = drug.userGuideline?.annotations.implication;
final recommendationText = drug.userGuideline?.annotations.recommendation;
final descriptionStyle = TextStyle(fontStyle: FontStyle.italic);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -80,10 +81,15 @@ class GuidelineAnnotationCard extends StatelessWidget {
Text.rich(
TextSpan(
children: [
if (implicationText != null) TextSpan(
if (
implicationText != null &&
drug.warningLevel != WarningLevel.none
) TextSpan(
text: context.l10n.drugs_page_implication_description,
style: descriptionStyle,
),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.2)),
TextSpan(text: ':\n', style: descriptionStyle),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.3)),
TextSpan(
text:
implicationText ?? context.l10n.drugs_page_no_guidelines_text,
Expand All @@ -95,13 +101,19 @@ class GuidelineAnnotationCard extends StatelessWidget {
),
),
if (recommendationText != null) ...[
SizedBox(height: PharMeTheme.smallToMediumSpace),
SizedBox(height: PharMeTheme.mediumSpace),
Text.rich(
TextSpan(children: [
TextSpan(
text: context.l10n.drugs_page_recommendation_description,
text: context.l10n.drugs_page_recommendation_description_part_1,
style: descriptionStyle,
),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.2)),
TextSpan(
text: context.l10n.drugs_page_recommendation_description_part_2,
style: descriptionStyle.copyWith(fontWeight: FontWeight.bold),
),
TextSpan(text: ':\n', style: descriptionStyle),
WidgetSpan(child: SizedBox(height: PharMeTheme.mediumSpace * 1.3)),
TextSpan(
text: recommendationText,
style: TextStyle(fontWeight: FontWeight.bold),
Expand Down
8 changes: 5 additions & 3 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@
},
"drugs_page_tooltip_guideline_missing": "Guidelines provide recommendations on which medications to use based on your genes. 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": "What your gene result means",
"@drugs_page_implication_description": {},
"drugs_page_recommendation_description": "What to do: ",
"@drugs_page_recommendation_description": {},
"drugs_page_recommendation_description_part_1": "What to do",
"@drugs_page_recommendation_description_part_1": {},
"drugs_page_recommendation_description_part_2": " based on your genes",
"@drugs_page_recommendation_description_part_2": {},

"report_content_explanation": "This is your PGx (pharmacogenomic) test report. Tap on a gene name for more details on your results and a list of associated medications.",
"@report_content_explanation": {},
Expand Down

0 comments on commit 02170b9

Please sign in to comment.