Flutter: How to crop text depending on available space? Flutter: How to crop text depending on available space? dart dart

Flutter: How to crop text depending on available space?


Setting overflow behavior should do

  new Text(    widget.text,    // softWrap: true,    overflow: TextOverflow.fade,  )

See also Flutter: How to hide or show more text within certain length


Wrap the text widget Inside Expanded or Flexible widget and use overflow.ellipsis this worked for me

Column(    children: <Widget>[         Flexible(             child: Text(             "Some Very long Text or random generated strings ",             overflow: TextOverflow.ellipsis,             softWrap: true,             ),        ),    ], ),