diff --git a/app/lib/common/widgets/drug_list/builder.dart b/app/lib/common/widgets/drug_list/builder.dart index bc666d09..75023e4f 100644 --- a/app/lib/common/widgets/drug_list/builder.dart +++ b/app/lib/common/widgets/drug_list/builder.dart @@ -53,7 +53,17 @@ class DrugList extends HookWidget { searchForDrugClass: searchForDrugClass, ).sortedBy((drug) => drug.name); if (filteredDrugs.isEmpty && noDrugsMessage != null) { - return buildContainer(noDrugsMessage: errorIndicator(noDrugsMessage!)); + return buildContainer( + noDrugsMessage: Column( + children: [ + _buildIncludedMedicationsDescription( + context, + addRightPadding: PharMeTheme.mediumSpace, + ), + errorIndicator(noDrugsMessage!), + ], + ), + ); } List? activeDrugsList; // Do not show repeated active drugs when searching in medication selection @@ -91,6 +101,7 @@ class DrugList extends HookWidget { final currentlyExpanded = otherDrugsExpanded.value ?? false; final currentlyEnabled = !drugActivityChangeable && filter.query.isBlank; final drugLists = [ + _buildIncludedMedicationsDescription(context), if (activeDrugsList != null) ...[ ListDescription( key: Key('header-active'), @@ -148,6 +159,20 @@ class DrugList extends HookWidget { ); } + Widget _buildIncludedMedicationsDescription( + BuildContext context, + { double addRightPadding = 0.0 } + ) => + ListPageInclusionDescription( + key: Key('inclusion-description'), + type: ListPageInclusionDescriptionType.medications, + customPadding: EdgeInsets.only( + left: PharMeTheme.smallSpace, + right: PharMeTheme.smallSpace + addRightPadding, + top: PharMeTheme.smallSpace * 1.5, + ), + ); + @override Widget build(BuildContext context) { final otherDrugsExpanded = useState(null); diff --git a/app/lib/common/widgets/drug_search/builder.dart b/app/lib/common/widgets/drug_search/builder.dart index 2e4b436b..95d652c4 100644 --- a/app/lib/common/widgets/drug_search/builder.dart +++ b/app/lib/common/widgets/drug_search/builder.dart @@ -61,15 +61,6 @@ class DrugSearch extends HookWidget { ), ), ), - ListPageInclusionDescription( - type: ListPageInclusionDescriptionType.medications, - customPadding: EdgeInsets.only( - left: PharMeTheme.smallSpace, - right: PharMeTheme.smallSpace, - top: PharMeTheme.smallSpace * 1.5, - bottom: PharMeTheme.smallSpace, - ), - ), if (children != null) scrollList( keepPosition: keepPosition, children, diff --git a/app/lib/report/pages/gene.dart b/app/lib/report/pages/gene.dart index 9ec07816..9db489ad 100644 --- a/app/lib/report/pages/gene.dart +++ b/app/lib/report/pages/gene.dart @@ -92,11 +92,6 @@ class GenePage extends HookWidget { genotypeResult.geneDisplayString ), ), - SizedBox(height: PharMeTheme.mediumSpace), - ListPageInclusionDescription( - type: ListPageInclusionDescriptionType.medications, - customPadding: EdgeInsets.zero, - ), ], ), ), diff --git a/app/lib/report/pages/report.dart b/app/lib/report/pages/report.dart index c1534cb9..7000b214 100644 --- a/app/lib/report/pages/report.dart +++ b/app/lib/report/pages/report.dart @@ -175,10 +175,7 @@ class ReportPage extends HookWidget { body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ListPageInclusionDescription( - text: context.l10n.report_content_explanation, - type: ListPageInclusionDescriptionType.genes, - ), + PageDescription.fromText(context.l10n.report_content_explanation), scrollList( _buildReportLists( context, @@ -249,13 +246,24 @@ class ReportPage extends HookWidget { drugsToFilterBy: null, onlyCurrentMedications: false, ); + final inclusionDescription = ListPageInclusionDescription( + key: Key('included-gene-explanation'), + type: ListPageInclusionDescriptionType.genes, + customPadding: EdgeInsets.only( + left: PharMeTheme.smallSpace, + right: PharMeTheme.smallSpace, + top: PharMeTheme.smallSpace * 1.5, + ), + ); if (currentMedicationGenes.isEmpty) { return [ + inclusionDescription, allMedicationGenesHeader, ...allMedicationGenes, ]; } return [ + inclusionDescription, _listDescription( context, context.l10n.report_current_medications,