Skip to content

Commit

Permalink
fix(app): fix overflow of long drug names on cards
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 26, 2024
1 parent d72ecec commit 8a9ece0
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions app/lib/common/widgets/drug_list/drug_items/drug_cards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,25 @@ class DrugCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
drug.warningLevel.icon,
color: PharMeTheme.onSurfaceText,
Text.rich(
TextSpan(
style: PharMeTheme.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
),
SizedBox(width: 4),
Text(
drugName,
style: PharMeTheme.textTheme.titleMedium!
.copyWith(fontWeight: FontWeight.bold),
),
],
children: [
WidgetSpan(
child: Icon(
drug.warningLevel.icon,
color: PharMeTheme.onSurfaceText,
),
alignment: PlaceholderAlignment.middle,
),
TextSpan(text: ' '),
TextSpan(text: drugName),
],
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
SizedBox(height: PharMeTheme.smallSpace / 2),
if (drug.annotations.brandNames.isNotEmpty) ...[
Expand Down

0 comments on commit 8a9ece0

Please sign in to comment.