diff --git a/app/ios/Runner/Info.plist b/app/ios/Runner/Info.plist
index 3862294c..7b584b9d 100644
--- a/app/ios/Runner/Info.plist
+++ b/app/ios/Runner/Info.plist
@@ -46,5 +46,9 @@
UIViewControllerBasedStatusBarAppearance
+ CADisableMinimumFrameDurationOnPhone
+
+ UIApplicationSupportsIndirectInputEvents
+
diff --git a/app/lib/common/utilities/pdf_utils.dart b/app/lib/common/utilities/pdf_utils.dart
index c2dc7e01..796cc50b 100644
--- a/app/lib/common/utilities/pdf_utils.dart
+++ b/app/lib/common/utilities/pdf_utils.dart
@@ -259,24 +259,41 @@ List _buildUserPart(
];
}
+pw.Text _buildInfoText(String text) => pw.Text(
+ text,
+ style: pw.TextStyle(fontStyle: pw.FontStyle.italic),
+);
+
List _buildExternalGuidelinePart(
Drug drug,
BuildContext buildContext
) {
- final externalData = drug.userGuideline?.externalData;
- final heading = _buildSubheading(
- buildContext.l10n.pdf_heading_clinical_guidelines
- );
- return externalData == null ?
- [ heading, _buildTextBlockSpacer(), pw.Text(buildContext.l10n.pdf_no_value) ] :
- [
- heading,
- _buildTextBlockSpacer(),
- pw.Text(
- buildContext.l10n.pdf_info_clinical_guidelines,
- style: pw.TextStyle(fontStyle: pw.FontStyle.italic),
+ final heading = [
+ _buildSubheading(
+ buildContext.l10n.pdf_heading_clinical_guidelines
+ ),
+ _buildTextBlockSpacer(),
+ ];
+ if (drug.userOrFirstGuideline == null) {
+ return [
+ ...heading,
+ _buildInfoText(buildContext.l10n.drugs_page_guidelines_empty(drug.name)),
+ ];
+ }
+ if (drug.userGuideline == null) {
+ return [
+ ...heading,
+ _buildInfoText(
+ buildContext.l10n.pdf_info_clinical_guidelines_no_phenotype_guidelines,
),
- ...externalData.fold([], (externalGuidelines, guideline) =>
+ _buildTextBlockSpacer(),
+ ..._buildGuidelineUrls(drug, buildContext),
+ ];
+ }
+ return [
+ ...heading,
+ _buildInfoText(buildContext.l10n.pdf_info_clinical_guidelines),
+ ...drug.userGuideline!.externalData.fold([], (externalGuidelines, guideline) =>
[
...externalGuidelines,
_buildTextBlockSpacer(),
@@ -284,8 +301,31 @@ List _buildExternalGuidelinePart(
..._buildGuidelinePart(guideline, buildContext)
]
),
- _buildTextDivider()
- ];
+ _buildTextDivider(),
+ ];
+}
+
+pw.UrlLink _buildLink(String destination, { String? displayText }) =>
+ pw.UrlLink(
+ child: pw.Text(
+ displayText ?? destination,
+ style: pw.TextStyle(
+ color: PdfColors.blue500,
+ decoration: pw.TextDecoration.underline,
+ )
+ ),
+ destination: destination,
+ );
+
+List _buildGuidelineUrls(Drug drug, BuildContext buildContext) {
+ return [
+ ...drug.userOrFirstGuideline!.externalData.fold>([], (links, guideline) =>
+ [
+ ...links,
+ guideline.guidelineUrl,
+ ]
+ ).toSet().map(_buildLink),
+ ];
}
List _buildGuidelinePart(
@@ -306,16 +346,7 @@ List _buildGuidelinePart(
),
),
_PdfSegment(child:
- pw.UrlLink(
- child: pw.Text(
- guideline.guidelineUrl,
- style: pw.TextStyle(
- color: PdfColors.blue500,
- decoration: pw.TextDecoration.underline,
- )
- ),
- destination: guideline.guidelineUrl,
- )
+ _buildLink(guideline.guidelineUrl),
),
_buildTextSpacer(),
_PdfSegment(
diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb
index eab7779f..ea179d33 100644
--- a/app/lib/l10n/app_en.arb
+++ b/app/lib/l10n/app_en.arb
@@ -261,7 +261,8 @@
"pdf_pgx_report": "PGx Report",
"pdf_heading_user_data": "User data",
"pdf_heading_clinical_guidelines": "Clinical guideline(s)",
- "pdf_info_clinical_guidelines": "Clinical guideline(s) relevant for the phenotype. For more fine-grained information (e.g., in case of different guidelines for the user's phenotype) please refer to the original guideline (see URLs below).",
+ "pdf_info_clinical_guidelines": "For more fine-grained information please refer to the original guideline(s) by following the URL(s) below.",
+ "pdf_info_clinical_guidelines_no_phenotype_guidelines": "No guidelines were found for the user's phenotype. For further guideline information please refer to the URL(s) below.\n\nPlease note that it is possible that the guideline includes relevant information for the user's phenotype, although it could not be identified by PharMe.",
"pdf_no_value": "n/a",
"pdf_indication": "Indication",
"pdf_brand_names": "Brand names",