简体   繁体   中英

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.

在此处输入图像描述

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

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

Wrap the second Column Widget with Flexible widget.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM