diff --git a/app/lib/faq/constants.dart b/app/lib/faq/constants.dart index 3683a3de..83040596 100644 --- a/app/lib/faq/constants.dart +++ b/app/lib/faq/constants.dart @@ -1,61 +1,95 @@ -class Question { +import '../common/module.dart'; + +abstract class Question { const Question({ required this.question, required this.answer, }); final String question; - final String answer; + final dynamic answer; +} + +class TextAnswerQuestion extends Question { + const TextAnswerQuestion({ + required super.question, + required String super.answer, + }); +} + +class WidgetAnswerQuestion extends Question { + const WidgetAnswerQuestion({ + required super.question, + required Widget super.answer, + }); } final Map> faqList = { 'Pharmacogenetics (PGx)': [ - Question( + TextAnswerQuestion( question: 'What is pharmacogenetics?', answer: 'Pharmacogenetics (PGx) is the study of how your genes (DNA) affect your response to drugs.', ), - Question( + TextAnswerQuestion( question: 'Why is pharmacogenetics important?', answer: 'Pharmacogenetics is important because it helps to predict those who will respond well to drugs and those who may have side effects. With this information we can better select the right drug and dose to avoid side effects.', ), - Question( + TextAnswerQuestion( question: 'Which drugs are affected?', answer: 'Examples of affected drug classes include anti-clotting medications (like clopidogrel and warfarin), antidepressants (like sertraline, citalopram, and paroxetine), anti-cholesterol drugs (like simvastatin and atorvastatin), acid reducers (like pantoprazole and omeprazole), pain killers (like codeine, tramadol, and ibuprofen), antifungals (like voriconazole), drugs that suppress the immune system (like tacrolimus), and anti-cancer drugs (like fluorouracil and irinotecan). You can find out whether a certain drug is affected in the Search tab.', ), - Question( + TextAnswerQuestion( question: 'Will my results affect my family members?', answer: 'Yes, since this is a genetic test, it is possible that your results were passed down to you and your siblings from your parents and you will also pass them down to your children.', ), - Question( + TextAnswerQuestion( question: 'Who can I share my results with?', answer: 'We recommend that you share your results with your pharmacists, doctors, and close family members such as parents, siblings, and children.', ), + WidgetAnswerQuestion( + question: 'Where can I find out more about genetics?', + answer: RichText(text: TextSpan( + // context.l10n.genetic_information_text_part_1 + text: 'If you would like to learn more about genetics, you can visit ', + style: PharMeTheme.textTheme.titleMedium, + children: [ + linkTextSpan( + text: 'MedlinePlus', // context.l10n.genetic_information_source + onTap: openFurtherGeneticInformation, + ), + TextSpan( + // context.l10n.genetic_information_text_part_2 + text: ', a service of the National Library of Medicine.', + ), + ], + )), + ) ], 'PharMe App': [ - Question( + TextAnswerQuestion( question: 'What does PharMe do?', answer: 'PharMe provides user-friendly information on how your body reacts to drugs based on your genes. This enables you to better understand which drugs may be ineffective for you or could have potential side effects. We recommend that you share consult your health care team before making any changes to your treatments.', ), - Question( + TextAnswerQuestion( question: 'Can I use PharMe\'s results without consulting a medical professional?', answer: 'No. Whether a drug is a good choice for you depends on a lot of other factors such as age, weight, or pre-existing conditions. We highly recommend that you talk to your health care team (e.g., pharmacist and doctors) before taking, stopping or adjusting the dose of any drug.', ), - Question( + TextAnswerQuestion( question: 'Where does PharMe get its data from?', answer: "PharMe is showing pharmacogenomic guidelines from the Clinical Pharmacogenetics Implementation Consortium (CPIC®) and the U.S. Food and Drug Administration (FDA). Our PGx experts adapted the language from the guidelines to make them more user-friendly and easier to understand; please note that this does only affect the guidelines' presentation, not affect the guidelines' statements.", ), ], 'Data security': [ - Question( + TextAnswerQuestion( question: 'How is the security of my genetic data ensured?', answer: 'Once securely imported from the lab, your genetic data is re-encrypted, saved and never sent anywhere else. All computation is done on your phone. When fetching data from external resources, PharMe always uses generalized requests and only personalizes information locally on your phone. No personal data is sent to third parties. This provides the highest level of security for your personal information.', diff --git a/app/lib/faq/pages/faq.dart b/app/lib/faq/pages/faq.dart index 3905c7ee..6749aeb0 100644 --- a/app/lib/faq/pages/faq.dart +++ b/app/lib/faq/pages/faq.dart @@ -86,7 +86,9 @@ class FaqPage extends StatelessWidget { right: PharMeTheme.mediumSpace, bottom: PharMeTheme.smallSpace, ), - title: Text(question.answer), + title: question is TextAnswerQuestion + ? Text(question.answer) + : question.answer, ), ], ), diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index 0c863143..de485dac 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -27,6 +27,10 @@ "auth_sign_in": "Get data", "auth_success": "Successfully imported data", + "genetic_information_text_part_1": "If you would like to learn more about genetics, you can visit ", + "genetic_information_text_part_2": ", a service of the National Library of Medicine.", + "genetic_information_source": "MedlinePlus", + "drug_selection_header": "Select active drugs", "drug_selection_onboarding_description": "Please update which drugs you are currently taking below. You can always change the status for a drug later on a drug page or in the settings.", "drug_selection_no_drugs_loaded": "No drugs loaded", @@ -206,9 +210,6 @@ "drugs_page_recommendation_warfarin": "Consult your pharmacist or doctor for more information.", "report_content_explanation": "Here is your PGx report. Tap on a gene name for more details on your results and a list of implicated drugs.", - "report_genetic_information_part_1": "If you would like to learn more about genetics, please visit ", - "report_genetic_information_part_2": ", a service of the National Library of Medicine.", - "genetic_information_source": "MedlinePlus", "report_page_indicator_explanation": "Phenotypes followed by an {indicatorName} ({indicator}) might be influenced by drugs you are currently taking", "@report_page_indicator_explanation": { "placeholders": { @@ -361,6 +362,7 @@ "settings_page_terms_and_conditions": "Terms of use", "settings_page_terms_and_conditions_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "settings_page_help_and_feedback": "Help & Feedback", + "settings_page_genetic_information": "Learn about genetics (MedlinePlus)", "settings_page_contact_us": "Contact us", "comprehension_intro_text": "Would you like to participate in a survey aiming to measure user comprehension of content in the app? This would help us make PharMe more understandable for everyone!", diff --git a/app/lib/more/pages/more.dart b/app/lib/more/pages/more.dart index 325784c9..a417f4c0 100644 --- a/app/lib/more/pages/more.dart +++ b/app/lib/more/pages/more.dart @@ -53,6 +53,9 @@ class MorePage extends StatelessWidget { text: context.l10n.settings_page_help_and_feedback, useLine: false, ), + _buildSettingsItem( + title: context.l10n.settings_page_genetic_information, + onTap: openFurtherGeneticInformation), _buildSettingsItem( title: context.l10n.settings_page_contact_us, onTap: sendEmail) diff --git a/app/lib/report/pages/report.dart b/app/lib/report/pages/report.dart index b76f602f..edd93649 100644 --- a/app/lib/report/pages/report.dart +++ b/app/lib/report/pages/report.dart @@ -36,7 +36,7 @@ class ReportPage extends StatelessWidget { PageDescriptionText(context.l10n.report_content_explanation), SizedBox(height: PharMeTheme.smallSpace), RichText(text: TextSpan( - text: context.l10n.report_genetic_information_part_1, + text: context.l10n.genetic_information_text_part_1, style: pageDescriptionTextStyle, children: [ linkTextSpan( @@ -44,11 +44,11 @@ class ReportPage extends StatelessWidget { onTap: openFurtherGeneticInformation, ), TextSpan( - text: context.l10n.report_genetic_information_part_2, + text: context.l10n.genetic_information_text_part_2, style: pageDescriptionTextStyle, ), ], - )) + )), ])), scrollList( userGenotypes.map((genotypeResult) => GeneCard(