diff --git a/app/lib/faq/pages/faq.dart b/app/lib/faq/pages/faq.dart index 12c8b6e7..cdc7f668 100644 --- a/app/lib/faq/pages/faq.dart +++ b/app/lib/faq/pages/faq.dart @@ -6,26 +6,29 @@ class FaqPage extends StatelessWidget { @override Widget build(BuildContext context) { - return pageScaffold(title: context.l10n.tab_faq, body: [ - Padding( - padding: const EdgeInsets.all(8), - child: Column( - key: Key('questionsColumn'), - children: [ - SizedBox(height: 8), - ...faqList.keys.fold>( - [], (widgets, topic) => - [...widgets, ..._buildTopic(context, topic, faqList[topic]!)] - ), - Divider(), - ListTile( - title: Text(context.l10n.faq_contact_us), - trailing: Icon(Icons.chevron_right_rounded), - onTap: sendEmail) - ], + return WillPopScope( + child: pageScaffold(title: context.l10n.tab_faq, body: [ + Padding( + padding: const EdgeInsets.all(8), + child: Column( + key: Key('questionsColumn'), + children: [ + SizedBox(height: 8), + ...faqList.keys.fold>( + [], (widgets, topic) => + [...widgets, ..._buildTopic(context, topic, faqList[topic]!)] + ), + Divider(), + ListTile( + title: Text(context.l10n.faq_contact_us), + trailing: Icon(Icons.chevron_right_rounded), + onTap: sendEmail) + ], + ), ), - ), - ]); + ]), + onWillPop: () async => false, + ); } List _buildTopic( diff --git a/app/lib/report/pages/report.dart b/app/lib/report/pages/report.dart index dd7a5a85..84524a03 100644 --- a/app/lib/report/pages/report.dart +++ b/app/lib/report/pages/report.dart @@ -25,24 +25,27 @@ class ReportPage extends StatelessWidget { lookupkey: notTestedString ) ); - return unscrollablePageScaffold( - title: context.l10n.tab_report, - barBottom: context.l10n.report_content_explanation, - body: Column( - children: [ - scrollList( - userPhenotypes.map((phenotype) => - Column( - key: Key('gene-card-${phenotype.geneSymbol}'), - children: [ - GeneCard(phenotype), - SizedBox(height: 8) - ] - ) - ).toList()), - if (hasActiveInhibitors) drugInteractionExplanation(context), - ] - ) + return WillPopScope( + child: unscrollablePageScaffold( + title: context.l10n.tab_report, + barBottom: context.l10n.report_content_explanation, + body: Column( + children: [ + scrollList( + userPhenotypes.map((phenotype) => + Column( + key: Key('gene-card-${phenotype.geneSymbol}'), + children: [ + GeneCard(phenotype), + SizedBox(height: 8) + ] + ) + ).toList()), + if (hasActiveInhibitors) drugInteractionExplanation(context), + ] + ) + ), + onWillPop: () async => false, ); } diff --git a/app/lib/search/pages/search.dart b/app/lib/search/pages/search.dart index f528ce72..e7aeb1c9 100644 --- a/app/lib/search/pages/search.dart +++ b/app/lib/search/pages/search.dart @@ -18,14 +18,17 @@ class SearchPage extends HookWidget { await cubit.loadDrugs(useCache: false); } }); - return unscrollablePageScaffold( - title: context.l10n.tab_drugs, - body: DrugSearch( - showFilter: true, - buildDrugItems: buildDrugCards, - cubit: cubit, - showDrugInteractionIndicator: true, + return WillPopScope( + child: unscrollablePageScaffold( + title: context.l10n.tab_drugs, + body: DrugSearch( + showFilter: true, + buildDrugItems: buildDrugCards, + cubit: cubit, + showDrugInteractionIndicator: true, + ), ), + onWillPop: () async => false, ); } } diff --git a/app/lib/settings/pages/settings.dart b/app/lib/settings/pages/settings.dart index 51c779d1..3c522d87 100644 --- a/app/lib/settings/pages/settings.dart +++ b/app/lib/settings/pages/settings.dart @@ -7,63 +7,66 @@ class SettingsPage extends StatelessWidget { @override Widget build(BuildContext context) { - return pageScaffold(title: context.l10n.tab_more, body: [ - ListTile( - title: Text( - context.l10n.settings_page_account_settings, - style: PharMeTheme.textTheme.bodyMedium, + return WillPopScope( + child: pageScaffold(title: context.l10n.tab_more, body: [ + ListTile( + title: Text( + context.l10n.settings_page_account_settings, + style: PharMeTheme.textTheme.bodyMedium, + ), + dense: true, + ), + ListTile( + title: Text(context.l10n.drug_selection_header), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => context.router.push( + DrugSelectionRouter(concludesOnboarding: false) + ), + ), + ListTile( + title: Text(context.l10n.settings_page_delete_data), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => showDialog( + context: context, + builder: (_) => DeleteDataDialog(), + ), ), - dense: true, - ), - ListTile( - title: Text(context.l10n.drug_selection_header), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => context.router.push( - DrugSelectionRouter(concludesOnboarding: false) + Divider(), + ListTile( + title: Text( + context.l10n.settings_page_more, + style: PharMeTheme.textTheme.bodyMedium, + ), + dense: true, ), - ), - ListTile( - title: Text(context.l10n.settings_page_delete_data), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => showDialog( - context: context, - builder: (_) => DeleteDataDialog(), + ListTile( + title: Text(context.l10n.settings_page_onboarding), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => context.router.push(OnboardingRouter(isRevisiting: true)), ), - ), - Divider(), - ListTile( - title: Text( - context.l10n.settings_page_more, - style: PharMeTheme.textTheme.bodyMedium, + ListTile( + title: Text(context.l10n.settings_page_about_us), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => context.router.push(AboutUsRoute()), ), - dense: true, - ), - ListTile( - title: Text(context.l10n.settings_page_onboarding), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => context.router.push(OnboardingRouter(isRevisiting: true)), - ), - ListTile( - title: Text(context.l10n.settings_page_about_us), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => context.router.push(AboutUsRoute()), - ), - ListTile( - title: Text(context.l10n.settings_page_privacy_policy), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => context.router.push(PrivacyPolicyRoute()), - ), - ListTile( - title: Text(context.l10n.settings_page_terms_and_conditions), - trailing: Icon(Icons.chevron_right_rounded), - onTap: () => context.router.push(TermsAndConditionsRoute()), - ), - Divider(), - ListTile( - title: Text(context.l10n.settings_page_contact_us), + ListTile( + title: Text(context.l10n.settings_page_privacy_policy), trailing: Icon(Icons.chevron_right_rounded), - onTap: sendEmail) - ]); + onTap: () => context.router.push(PrivacyPolicyRoute()), + ), + ListTile( + title: Text(context.l10n.settings_page_terms_and_conditions), + trailing: Icon(Icons.chevron_right_rounded), + onTap: () => context.router.push(TermsAndConditionsRoute()), + ), + Divider(), + ListTile( + title: Text(context.l10n.settings_page_contact_us), + trailing: Icon(Icons.chevron_right_rounded), + onTap: sendEmail) + ]), + onWillPop: () async => false, + ); } }