flutter - 在列中换行
问题描述
如您所见,我遇到了文本溢出问题。我希望用省略号修剪该文本,但我不知道该怎么做。目前我有:
Widget buildCardLeft() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Text(
this.transaction.title,
style: TextStyle(fontSize: 24),
overflow: TextOverflow.ellipsis,
),
),
SizedBox(
height: 8,
),
Text(
dateFormat.format(this.transaction.date),
style: TextStyle(color: Colors.grey),
)
],
);
截断此文本的正确方法是什么?
解决方案
你可以这样说:
Text(
this.transaction.title.replaceRange(25, this.transaction.title.length, "...",
style: TextStyle(fontSize: 24),
overflow: TextOverflow.ellipsis,
)
推荐阅读
- javascript - Pipedrive 网络表单未在反应引导模式中加载
- python - 如何通过 SAML ADFS 向 AWS 进行身份验证?
- hadoop - Apache Knox Ldap 集成失败
- python - Kivy 将视频合并到导航抽屉
- flutter - 每两个项目的混合布局中的颤振列表项目
- python-3.x - 如何从视频文件中提取清晰的帧?
- webpack - 对供应商块进行摇树是否有害?
- python - NGROK 返回错误 401 以松弛发出 POST 请求
- c# - Insert Into 语句中的语法错误,将数据插入特定列
- pandas - 通过循环遍历数据框来堆叠 Seaborn Catplot