I got a Stack-Widget with two childs. The first one is an image, the second one is text. I want to place the text on top of the image, hence the Stack. But when the text is quite long, the text overflows on the left and right. I want it to stay on the image. How can I limit the stacks width to the width of the image?
My Code:
Stack(
alignment: Alignment.bottomCenter,
children: [
ExtendedImage.network(
UserSession().currentImgURL!,
fit: BoxFit.fitWidth,
cache: true,
cacheWidth: 1000,
enableMemoryCache: false,
enableLoadState: true,
),
OutlinedText(
text: Text(title, style: TextStyle(fontSize: kIsWeb ? 5.sp : 18.sp, height: 1.1)),
strokes: [
OutlinedTextStroke(color: Colors.black, width: 5),
],
)
],
)

