我正在努力实现以下布局inside a row(请参见附图):
- 文本字段,有3行
- 正方形图像容器(纵横比为1:1),其中图像具有封面大小
Constraints:
I want the TextField to set the height of the row, so no matter how big or small the font size, the image will always be square, and its height the same as the TextField height.
So I don't want to use any pixel sizes
This is my initial code, but of course the image is not constrained...
Any ideas on how to fix that?
IntrinsicHeight(
child: Row(
children: [
Flexible(
child: TextField(
controller: _controller,
maxLines: 3,
),
),
Image.file(File(imagePath), fit: BoxFit.cover)
],
),
)