Flutter Multiline for text

前端 未结 8 886
春和景丽
春和景丽 2021-02-06 22:23

All I need is my text to be multi-line. Am giving the property of maxLines but its still getting RenderFlex overflowed error to the right as the next i

相关标签:
8条回答
  • 2021-02-06 23:09

    Just wrap your text widget with Expanded as below

        Expanded(
          child: Text('data', maxLines: 4,
            overflow: TextOverflow.ellipsis,
            textDirection: TextDirection.rtl,
            textAlign: TextAlign.justify,),
        ),
    
    0 讨论(0)
  • 2021-02-06 23:13

    Use Expanded widget with column to achieve multiline text.

    Expanded(child: 
     Column(crossAxisAlignment: CrossAxisAlignment.start ,
     children: [
                Text(food.title),
                Text(food.price)
               ]
    ))
    
    0 讨论(0)
提交回复
热议问题