jack the ripper
jack the ripper

Reputation: 153

Flutter: Text overflow for a Text inside a Column not working

Column(
  crossAxisAlignment: CrossAxisAlignment.start,
  children: [
    Text(showing.title, style: browseTitle, overflow: TextOverflow.ellipsis,),
    Text(showing.dates, style: browseInfo),
    SizedBox(
      height: 20,
    ),
    Text('Posted by: ' + showing.email, style: browseInfo),
  ],
),

This code produces this: Image

But the problem is that the textoverflow I put inside the text doesn't seem to be applying and the text keeps overflowing. How do I solve this so that the text doesn't overflow and it turns into an ellipsis?

Upvotes: 1

Views: 443

Answers (1)

Ravi Limbani
Ravi Limbani

Reputation: 1172

CheckOut this work perfect

Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
            width: MediaQuery.of(context).size.width,
            child: Text(
              showing.title,
              style: browseTitle,
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          Text(showing.dates, style: browseInfo),
          SizedBox(height: 20),
          Text('Posted by: ' + showing.email, style: browseInfo),
        ],
      ),

Upvotes: 1

Related Questions