diff --git a/app/lib/common/widgets/drug_activity_selection.dart b/app/lib/common/widgets/drug_activity_selection.dart index bc8351a1..4dc353c5 100644 --- a/app/lib/common/widgets/drug_activity_selection.dart +++ b/app/lib/common/widgets/drug_activity_selection.dart @@ -10,6 +10,7 @@ SwitchListTile buildDrugActivitySelection({ required BuildContext context, required Drug drug, required String title, + TextStyle? titleStyle, String? subtitle, required SetDrugActivityFunction setActivity, required bool isActive, @@ -23,7 +24,7 @@ SwitchListTile buildDrugActivitySelection({ inactiveThumbColor: PharMeTheme.surfaceColor, inactiveTrackColor: PharMeTheme.borderColor, trackOutlineColor: WidgetStatePropertyAll(Colors.transparent), - title: Text(title), + title: Text(title, style: titleStyle), subtitle: subtitle.isNotNullOrBlank ? Text(subtitle!, style: PharMeTheme.textTheme.bodyMedium): null, contentPadding: contentPadding, onChanged: disabled ? null : (newValue) { diff --git a/app/lib/drug/widgets/annotation_cards/drug.dart b/app/lib/drug/widgets/annotation_cards/drug.dart index 6494bd6e..74fc1b77 100644 --- a/app/lib/drug/widgets/annotation_cards/drug.dart +++ b/app/lib/drug/widgets/annotation_cards/drug.dart @@ -19,15 +19,34 @@ class DrugAnnotationCards extends StatelessWidget { return Column( children: [ RoundedCard( - innerPadding: EdgeInsets.symmetric(horizontal: PharMeTheme.mediumSpace), - child: buildDrugActivitySelection( - context: context, - drug: drug, - setActivity: setActivity, - title: context.l10n.drugs_page_text_active, - isActive: isActive, - disabled: disabled, - contentPadding: EdgeInsets.zero, + innerPadding: EdgeInsets.symmetric( + horizontal: PharMeTheme.mediumSpace, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (drug.annotations.brandNames.isNotEmpty) ...[ + SizedBox(height: PharMeTheme.mediumSpace), + buildTable([ + TableRowDefinition( + context.l10n.drug_item_brand_names, + drug.annotations.brandNames.join(', '), + ), + ]), + ], + buildDrugActivitySelection( + context: context, + drug: drug, + setActivity: setActivity, + title: context.l10n.drugs_page_text_active, + titleStyle: PharMeTheme.textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.bold, + ), + isActive: isActive, + disabled: disabled, + contentPadding: EdgeInsets.zero, + ), + ], ), ), SizedBox(height: PharMeTheme.smallSpace), @@ -52,11 +71,6 @@ class DrugAnnotationCards extends StatelessWidget { context.l10n.drugs_page_header_drugclass, drug.annotations.drugclass, ), - if (drug.annotations.brandNames.isNotEmpty) - TableRowDefinition( - context.l10n.drug_item_brand_names, - drug.annotations.brandNames.join(', '), - ), ]), ], ),