1

I am creating a card in Flutter, I want to cutoff the overflowing text but I cant seem to get it working.

enter image description here

return Card(
      child: InkWell(
        child: Padding(
          padding: const EdgeInsets.all(4.0),
          child: Column(
            children: [
              Text(task.tag + " " + task.tagomschrijving, style: TextStyle(fontSize: 16)),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Column(
                    mainAxisAlignment: MainAxisAlignment.start, 
                      crossAxisAlignment: CrossAxisAlignment.start,
                    children:[
                      Text("Task: " + task.taakomschrijving, overflow: TextOverflow.clip),
                      Text("Lubricant: " + task.smeermiddel),
                      if(task.aantalsmeerpunten != 0) Text("Quantity: " + task.aantalsmeerpunten.toString() + " x " + task.hoeveelheid.toString() + " " + task.eenheid),
                      if(task.aantalsmeerpunten == 0) Text(""),
                    ]
                  ),

2 Answers 2

1

Wrap the second Column Widget with Flexible widget.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer, I also found it myself. I modified my question because the layout wasn't as beautiful anymore.
1

I added the expanded widget at the Text level and not at column level. It is working now

4 Comments

For Future => If you face it again then wrape it in padding also you can use container and inside container you can use padding or you can you height and width of container of also expended wisget and also flexible :-)
For this question (cutoff) I don’t have the answer yet. Do you know it?
Wrape text in padding then give padding : EdgeInsets.only(right:5.0),
It worked with Flexible( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children:[ Text("Task: " + task.taakomschrijving, maxLines: 1, overflow: TextOverflow.ellipsis,),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.