So I have the following code to give an idea.
I need all of the Columns to have the same width, which is equal to the max width of the first row of text in all ListView items. Subsequent Text rows in the Column can be longer but will get clipped so will not increase the width of the column. The image also needs to fill the remaining space.
The reason I want to do this is so the UI will resize if the user changes the font size in the phone’s display settings, which will make all the text larger. The top row can’t be clipped but the other rows can.
The only thing I can think to do is somehow calculate this width in advance (no idea how) and then use that as a fixed width for the column
ListView.builder(
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
return Row(
children: [
Image.network(
<image url for item i>,
fit: BoxFit.cover,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Text for Column Row $index',
style: TextStyle(fontWeight: FontWeight.bold),
),
...
],
),
],
);
},
)