我正在尝试将所有图片(在尾随ListTile中)调整为第三张照片(以降低卡片)。

flutter - 调整图像尺寸以适应卡片抖动-LMLPHP

到目前为止,这是我的代码:

return Card(
child:ListTile(...
...
   trailing: LayoutBuilder(
            builder: (BuildContext context, BoxConstraints constraints) {
              return FadeInImage.memoryNetwork(
                height: constraints.maxHeight,
                placeholder: kTransparentImage,
                image: picture,
              );
            },
          ),

感谢您的帮助

最佳答案

通过@Manuel的建议-它是这样工作的:

            ...trailing: LayoutBuilder(
          builder: (BuildContext context, BoxConstraints constraints) {
            return FadeInImage.memoryNetwork(
              fit: BoxFit.cover,
              height: constraints.maxHeight,
              width: constraints.maxWidth/3,
              placeholder: kTransparentImage,
              image: picture,
            );
          },
        ),

关于flutter - 调整图像尺寸以适应卡片抖动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60887908/

10-13 03:55