I have a structure like this in one place in my app:
Expanded(child: InkWell(
onTap: () => doSomething(),
child: Container(
child: Row(children: [
Padding( child: Icon(Icons.warning, size: 22), padding: EdgeInsets.fromLTRB(0, 0, 8, 0), ),
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text('this is the very long text that doesnt fit on the screen and should be wrapped instead of overflowing'),
Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: _buildChildren(context)
)
])
]),
decoration: BoxDecoration(border: Border.all(color: appTheme.style.errorColor), borderRadius: BorderRadius.all(Radius.circular(8))),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
margin: EdgeInsets.fromLTRB(4, 2, 4, 2),
))
)
I've tried a lot of variations of wrapping the Text
with various kinds of combinations of Flexible
, Expanded
, Container
, FittedBox
, Row
, etc. etc. But none work - some make the text disappear and some don't do anything, while others give me a layout error... Short of using a fixed-width Container
I haven't found a way around this - is it even possible without resorting to fixed widths?