我想在不使用固定高度或宽度的情况下执行此操作,这样如果用户更改显示设置中的字体大小(这将更改包含文本的第二列的高度和宽度),它仍然看起来不错。
我能做的最好的事情是以下,但是较高的缩略图会导致容器更高,并且文本下方有一个间隙,而较宽的缩略图上方和下方有白色
此外,我读到使用 Intrinsic 小部件会降低性能,并且此容器将在列表视图中重复大约 100 次,因此不确定这是一个好主意
Container(
decoration: BoxDecoration(...),
child: IntrinsicHeight(
child: Row(
children: [
Expanded(
child: Image(
image: thumbnailProvider,
fit: BoxFit.cover,
),
),
const IntrinsicWidth(
child: Column(children: [
Text('hello'),
Text('something'),
Text('bla bla bla bla bla bla bla'),
]),
),
],
),
),
);
尝试使用flexible或boxfit代替IntrinsicWidth或IntrinsicHeight