in my Flutter task app I have a grid view for my items, and if the text is long it shortens the String value. Any solution for a full-text view?
CodePudding user response:
you should use auto_size_text
from pub.dev,
AutoSizeText(
'A really long String',
style: TextStyle(fontSize: 12),
minFontSize: 4,
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
CodePudding user response:
You can Wrap your Text Widget with FittedBox and give maximum width.
Set maxLines to 1 in Text widget.
SizedBox(
height: size.height * 0.1,
width: size.width * 0.28,
child: FittedBox(
child: Text(
"$number ",
maxLines: 1,
),
),
)