Skip to content

Commit

Permalink
fix(app): do not show inhibitor warning if indicators are not shown
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Nov 21, 2024
1 parent 5d9e9c9 commit 9d964e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/lib/common/widgets/drug_activity_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SwitchListTile buildDrugActivitySelection({
required bool isActive,
required bool disabled,
EdgeInsetsGeometry? contentPadding,
bool warnIfInhibitor = true,
}) => SwitchListTile.adaptive(
key: key,
value: isActive,
Expand All @@ -23,7 +24,7 @@ SwitchListTile buildDrugActivitySelection({
subtitle: subtitle.isNotNullOrBlank ? Text(subtitle!, style: PharMeTheme.textTheme.bodyMedium): null,
contentPadding: contentPadding,
onChanged: disabled ? null : (newValue) {
if (isInhibitor(drug.name)) {
if (warnIfInhibitor && isInhibitor(drug.name)) {
showAdaptiveDialog(
context: context,
builder: (context) => DialogWrapper(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ List<SwitchListTile> _buildSelectionList(
subtitle: (drug.annotations.brandNames.isNotEmpty) ?
formatBrandNames(context, drug) :
null,
warnIfInhibitor: showDrugInteractionIndicator,
)
).toList();
}

0 comments on commit 9d964e4

Please sign in to comment.