I have a Flutter app, and on one of the screens, I have a list of employees. The data for the employees is retrieved from an API. The issue I’m facing is that some of the employees have long names, causing the screen to overflow. How can I resolve this issue?
On this screen, all components are resizing based on the screen’s width and height. However, I’m having trouble solving the issue of text overflow in long names.
Text('$isim $soyisim',
overflow: TextOverflow.fade,
maxLines: 1,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w700,
fontSize: device.width * 0.05))
2
Answers
One Method is using a expanded or flexible widget
result:
Another way is using a Constraint Box widget:
result:
Lastly, you can add a maxline property and textoverflow property
result: