【发布时间】:2021-08-25 03:46:54
【问题描述】:
所以,我在颤振中构建这个应用程序,用户最多可以评论 150 个字符,当我试图显示它时,由于字符串的长度,会出现这个渲染溢出错误。那么,如何根据文本的长度将文本分散到多行并相应地显示它们。这里有一个类似的问题,但这并不能解决我的问题。我能得到一些帮助吗?
Container(
alignment: Alignment.center,
width: double.infinity,
height: 100.0,
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipOval(
child: Image.asset(
'assets/images/c1.png',
fit: BoxFit.cover,
width: 69,
height: 69,
),
),
),
Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'@username',
style: TextStyle(color: Colors.white),
),
Expanded(child: const Text('fwegergwefrvgervuhygtfvrcdxddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddne, a very long comment!!!',
textAlign: TextAlign.justify,
maxLines: 6,
overflow: TextOverflow.ellipsis,)),
],
),
],
),
),
【问题讨论】:
标签: android flutter dart flutter-layout cross-platform