I have a Widget tree like this:
Stack(
children: [
Text(
'-',
style: title,
),
Positioned.fill(
child: Center(
child: Text(
'FT',
style: normal,
),
),
)
],
),
I want the Stack to wrap_content both width and height to all the widget inside it like this:
But instead it look like this:
The Stack get the width and height from the un-fill Widget. If I wrap both Widget in Positioned.fill then the layout is empty. Any one know how to fix this? tks a lot.
You can use
alignment
property ofStack
widgetTry this
OUTPUT