JBoudry
JBoudry

Reputation: 97

Flutter overflow cutoff

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(""),
                    ]
                  ),

Upvotes: 1

Views: 833

Answers (2)

Hardik Mehta
Hardik Mehta

Reputation: 2415

Wrap the second Column Widget with Flexible widget.

Upvotes: 1

JBoudry
JBoudry

Reputation: 97

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

Upvotes: 1

Related Questions