I want to overlay a Card with a white container, but the container always needs a height (otherwise it's not displayed). I want it to be as big as its parent, the stack. How can I make this work? The height of the card varies. I guess I'm missing something ;)
return new Stack(
children: <Widget>[
new Card( ... ),
new Container(color: Colors.white70),
]
);
You can use a Positioned.fill
to force a stack child to fill Stack
.
Stack(
children: [
Card(),
Positioned.fill(
child: Container(color: Colors.red),
)
]
);
height: double.infinity
It worked for me in case of container
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With