I have a Container
that also has a Text
as a child
. The problem is that my text
is overflowing on the right. But actually I want it to break and the parent container should expand.
This is how it looks right now:
And my code:
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Padding(
padding: EdgeInsets.only(
bottom: 14.scaled,
),
child: Container(
// height: 70.scaled,
decoration: BoxDecoration(
boxShadow: [verySoftDarkShadow],
color: white,
borderRadius: BorderRadius.circular(10.scaled),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 20.scaled,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
shortArticle.label!,
style: alternativeText,
),
Text(
shortArticle.manufacturerLabel ?? '',
style: alternativeText.copyWith(color: darkGray),
),
],
),
Spacer(),
SvgIconButton(
onTap: () {
print('tapped');
},
svgPath: 'images/vertical_menue_dots.svg',
width: touchTargetSizeForIconButton,
height: touchTargetSizeForIconButton,
svgSize: 16.scaled,
),
],
),
),
),
);
}
}
I tried wrapping the text
-widget
inside a Expanded
but that just makes it overflowing and not displaying anything. What am I missing here? How can I solve this?
Let me know if you need any more info!