【发布时间】:2020-09-12 11:41:56
【问题描述】:
有头像,后跟用户名,然后是评论。但是如果评论太长,它应该从用户名下方开始,而不是从头像。
以下是我的代码
Row(
children: [
const CircleAvatar(
backgroundImage: NetworkImage(
'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTTul_FjIE5w2p_VarQyzwaZ1mkOYjQRXcNCA&usqp=CAU'),
radius: 16,
),
const SizedBox(
width: 10,
),
Text(
'UserName',
style: GoogleFonts.tenorSans(
color: Colors.black),
),
Text(
'The Dram Club is a platform that endeavours to bring whisky enthusiassts & aficionados together for people to enjoy their whiskes',
style: GoogleFonts.tenorSans(
color: Colors.black,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic),
)
],
)
对于上面的代码,如果注释文本很大,则注释文本会被截断,因此我决定使用Row,而不是使用Wrap,但这会将我的输入注释移动到新行中。我只是尝试将用户名和评论文本包装在 Wrap 中,但没有任何反应。我也尝试使用 Flexible 和 Expanded 小部件
【问题讨论】:
-
你能添加你的屏幕截图吗?