flutter Text 换行问题【转】

Text(
  S.current.task_detail_task_details + data.text,
  maxLines: 20,
  style: TextStyle(
    color: Color.fromRGBO(77, 99, 104, 1),
  ),
),

直接设置maxLines 发现有些场景会无效,解决方法 使用Expanded,如下:

Expanded(
  child: Text(
    S.current.task_detail_task_details + data.text,
    maxLines: 100,
    style: TextStyle(
      color: Color.fromRGBO(77, 99, 104, 1),
    ),
  ),
),

来源:https://www.cnblogs.com/lulushen/p/12967346.html

原文地址:https://www.cnblogs.com/KillBugMe/p/13602332.html