Use ellipsis overflow for subTitle in ActionItem

This commit is contained in:
Elias Bonnici 2024-04-16 16:19:24 +02:00
parent 21a1998946
commit 4cf5296de2
No known key found for this signature in database
GPG Key ID: 5EAC28EA3F980CCF
2 changed files with 5 additions and 2 deletions

View File

@ -65,6 +65,7 @@ class ActionListItem extends StatelessWidget {
text: subtitle!,
style: TextStyle(fontSize: theme.textTheme.bodyMedium!.fontSize),
maxLines: 2,
overflow: TextOverflow.ellipsis,
)
: null,
leading: Opacity(

View File

@ -21,12 +21,14 @@ class TooltipIfTruncated extends StatelessWidget {
final TextStyle style;
final String? tooltip;
final int maxLines;
final TextOverflow overflow;
const TooltipIfTruncated(
{super.key,
required this.text,
required this.style,
this.tooltip,
this.maxLines = 1});
this.maxLines = 1,
this.overflow = TextOverflow.fade});
@override
Widget build(BuildContext context) {
@ -35,7 +37,7 @@ class TooltipIfTruncated extends StatelessWidget {
final textWidget = Text(
text,
textAlign: TextAlign.left,
overflow: TextOverflow.fade,
overflow: overflow,
maxLines: maxLines,
softWrap: maxLines != 1,
style: style,