diff --git a/app/lib/common/models/drug/drug_inhibitors.dart b/app/lib/common/models/drug/drug_inhibitors.dart index 6a470d03..4f0bedd2 100644 --- a/app/lib/common/models/drug/drug_inhibitors.dart +++ b/app/lib/common/models/drug/drug_inhibitors.dart @@ -83,7 +83,7 @@ List inhibitorsFor(String gene) { return _drugInhibitorsPerGene[gene] ?? []; } -bool canBeInhibited(CpicLookup phenotype) { - return inhibitableGenes.contains(phenotype.gene) && - phenotype.lookupkey != '0.0'; +bool canBeInhibited(CpicLookup lookup) { + return inhibitableGenes.contains(lookup.gene) && + lookup.lookupkey != '0.0'; } diff --git a/app/lib/report/pages/gene.dart b/app/lib/report/pages/gene.dart index f226b0b0..b45f5d08 100644 --- a/app/lib/report/pages/gene.dart +++ b/app/lib/report/pages/gene.dart @@ -5,12 +5,12 @@ import '../../drug/widgets/module.dart'; @RoutePage() class GenePage extends HookWidget { - GenePage(this.phenotype) + GenePage(this.lookup) : cubit = DrugListCubit( - initialFilter: FilterState.forGene(phenotype.gene), + initialFilter: FilterState.forGene(lookup.gene), ); - final CpicLookup phenotype; + final CpicLookup lookup; final DrugListCubit cubit; @override @@ -20,7 +20,7 @@ class GenePage extends HookWidget { create: (context) => cubit, child: BlocBuilder( builder: (context, state) => pageScaffold( - title: context.l10n.gene_page_headline(phenotype.gene), + title: context.l10n.gene_page_headline(lookup.gene), body: [ Padding( padding: EdgeInsets.symmetric( @@ -31,9 +31,9 @@ class GenePage extends HookWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SubHeader( - context.l10n.gene_page_your_variant(phenotype.gene), + context.l10n.gene_page_your_variant(lookup.gene), tooltip: context.l10n - .gene_page_name_tooltip(phenotype.gene), + .gene_page_name_tooltip(lookup.gene), ), SizedBox(height: PharMeTheme.smallToMediumSpace), RoundedCard( @@ -49,16 +49,16 @@ class GenePage extends HookWidget { children: [ _buildRow( context.l10n.gene_page_genotype, - phenotype.genotype, + lookup.genotype, tooltip: context.l10n.gene_page_genotype_tooltip ), _buildPhenotypeRow(context), ], ), - if (canBeInhibited(phenotype)) + if (canBeInhibited(lookup)) ...buildDrugInteractionInfo( context, - phenotype.gene, + lookup.gene, ), ], )), @@ -80,7 +80,7 @@ class GenePage extends HookWidget { TableRow _buildPhenotypeRow(BuildContext context) { final phenotypeInformation = UserData.phenotypeInformationFor( - phenotype.gene, + lookup.gene, context, ); final phenotypeText = phenotypeInformation.adaptionText.isNotNullOrBlank diff --git a/app/lib/report/pages/report.dart b/app/lib/report/pages/report.dart index 01108c04..d38e7251 100644 --- a/app/lib/report/pages/report.dart +++ b/app/lib/report/pages/report.dart @@ -15,7 +15,7 @@ class ReportPage extends StatelessWidget { Widget _buildReportPage(BuildContext context, ActiveDrugs activeDrugs) { final hasActiveInhibitors = activeDrugs.names.any(isInhibitor); final notTestedString = context.l10n.general_not_tested; - final userPhenotypes = CachedDrugs.instance.allGuidelineGenes.map( + final userLookus = CachedDrugs.instance.allGuidelineGenes.map( (gene) => UserData.instance.lookups![gene] ?? // Add CpicLookup for unmatched lookup CpicLookup( @@ -27,7 +27,7 @@ class ReportPage extends StatelessWidget { notTestedString, lookupkey: notTestedString ) - ).sortedBy((phenotype) => phenotype.gene); + ).sortedBy((lookup) => lookup.gene); return PopScope( canPop: false, child: unscrollablePageScaffold( @@ -36,9 +36,9 @@ class ReportPage extends StatelessWidget { children: [ PageDescription(context.l10n.report_content_explanation), scrollList( - userPhenotypes.map((phenotype) => GeneCard( - phenotype, - key: Key('gene-card-${phenotype.gene}') + userLookus.map((lookup) => GeneCard( + lookup, + key: Key('gene-card-${lookup.gene}') )).toList(), ), if (hasActiveInhibitors) PageIndicatorExplanation( @@ -55,21 +55,21 @@ class ReportPage extends StatelessWidget { } class GeneCard extends StatelessWidget { - const GeneCard(this.phenotype, { super.key }); + const GeneCard(this.lookup, { super.key }); - final CpicLookup phenotype; + final CpicLookup lookup; @override Widget build(BuildContext context) { final phenotypeInformation = UserData.phenotypeInformationFor( - phenotype.gene, + lookup.gene, context, ); final phenotypeText = phenotypeInformation.adaptionText.isNullOrBlank ? phenotypeInformation.phenotype : '${phenotypeInformation.phenotype}$drugInteractionIndicator'; final affectedDrugs = CachedDrugs.instance.drugs?.filter( - (drug) => drug.guidelineGenes.contains(phenotype.gene) + (drug) => drug.guidelineGenes.contains(lookup.gene) ) ?? []; final warningLevelIndicators = WarningLevel.values.map( (warningLevel) { @@ -98,7 +98,7 @@ class GeneCard extends StatelessWidget { } ).toList(); return RoundedCard( - onTap: () => context.router.push(GeneRoute(phenotype: phenotype)), + onTap: () => context.router.push(GeneRoute(lookup: lookup)), radius: 16, child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( @@ -106,7 +106,7 @@ class GeneCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - phenotype.gene, + lookup.gene, style: PharMeTheme.textTheme.titleMedium ), SizedBox(height: 8),