diff --git a/app/lib/common/widgets/drug_list/drug_items/drug_cards.dart b/app/lib/common/widgets/drug_list/drug_items/drug_cards.dart index a41c223d..f773824a 100644 --- a/app/lib/common/widgets/drug_list/drug_items/drug_cards.dart +++ b/app/lib/common/widgets/drug_list/drug_items/drug_cards.dart @@ -73,8 +73,8 @@ class DrugCard extends StatelessWidget { if (drug.annotations.brandNames.isNotEmpty) ...[ SizedBox(width: PharMeTheme.smallSpace / 2), Text( - '(${drug.annotations.brandNames.join(', ')})', - style: PharMeTheme.textTheme.titleMedium, + formatBrandNames(context, drug), + style: PharMeTheme.textTheme.titleSmall, ), ], SizedBox(height: PharMeTheme.smallSpace * 0.75), diff --git a/app/lib/common/widgets/drug_list/drug_items/drug_checkbox_list.dart b/app/lib/common/widgets/drug_list/drug_items/drug_checkbox_list.dart index c733cccd..45c1b81b 100644 --- a/app/lib/common/widgets/drug_list/drug_items/drug_checkbox_list.dart +++ b/app/lib/common/widgets/drug_list/drug_items/drug_checkbox_list.dart @@ -20,12 +20,14 @@ List buildDrugCheckboxList( ), )] : _buildCheckboxList( + context, activeDrugs, buildParams, showDrugInteractionIndicator, keyPrefix: 'active', ); final allDrugsList = _buildCheckboxList( + context, drugs, buildParams, showDrugInteractionIndicator, @@ -48,6 +50,7 @@ List buildDrugCheckboxList( } List _buildCheckboxList( + BuildContext context, List drugs, Map buildParams, bool showDrugInteractionIndicator, @@ -63,7 +66,7 @@ List _buildCheckboxList( onChanged: (value) => onCheckboxChange(drug, value), title: formatDrugName(drug, showDrugInteractionIndicator), subtitle: (drug.annotations.brandNames.isNotEmpty) ? - '(${drug.annotations.brandNames.join(", ")})' : + formatBrandNames(context, drug) : null, ) ).toList(); diff --git a/app/lib/common/widgets/drug_list/drug_items/utils.dart b/app/lib/common/widgets/drug_list/drug_items/utils.dart index 77f8d0ee..3194d528 100644 --- a/app/lib/common/widgets/drug_list/drug_items/utils.dart +++ b/app/lib/common/widgets/drug_list/drug_items/utils.dart @@ -1,5 +1,9 @@ import '../../../module.dart'; +String formatBrandNames(BuildContext context, Drug drug) => + '${context.l10n.drug_item_brand_names}: ' + '${drug.annotations.brandNames.join(", ")}'; + String formatDrugName( Drug drug, // ignore: avoid_positional_boolean_parameters diff --git a/app/lib/drug/widgets/annotation_cards/drug.dart b/app/lib/drug/widgets/annotation_cards/drug.dart index 47fc3a88..2e75e233 100644 --- a/app/lib/drug/widgets/annotation_cards/drug.dart +++ b/app/lib/drug/widgets/annotation_cards/drug.dart @@ -35,7 +35,7 @@ class DrugAnnotationCards extends StatelessWidget { ), if (drug.annotations.brandNames.isNotEmpty) TableRowDefinition( - context.l10n.drugs_page_header_synonyms, + context.l10n.drug_item_brand_names, drug.annotations.brandNames.join(', '), ), ]), diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index 4f681ea1..9b005ccb 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -25,6 +25,8 @@ "auth_sign_in": "Get data", "auth_success": "Successfully imported data", + "drug_item_brand_names": "Brand names", + "drug_selection_header": "Current medications", "drug_selection_onboarding_description": "Please review the medications you are currently taking below and update them if needed. You can always change the status for a medication later on a medication page or in the settings.", "drug_selection_settings_description": "Review the medications you are currently taking below.", @@ -156,7 +158,6 @@ } } }, - "drugs_page_header_synonyms": "Other names", "drugs_page_header_drugclass": "Medication class", "drugs_page_header_drug": "Medication information", "drugs_page_header_active": "Usage status",