Flutter Stack size to sibling

Multi tool use
Multi tool use


Flutter Stack size to sibling



Is there a way to size a stack child automatically to its largest sibling?
I.e. if I have a Stack with a ListTile and a Container on top, how do I make sure the Container covers the entire ListTile?


Stack


ListTile


Container


Container


ListTile



Example:


new Stack(children: <Widget>[
new ListTile(
leading: new AssetImage('foo.jpg'),
title: new Text('Bar'),
subtitle: new Text('yipeee'),
isThreeLine: true,
),
new Container(color: Colors.grey, child: new Text('foo'))
],
)



I tried to make it work with Row, Column and Expanded but am running into problems with unbounded constraints.


Row


Column


Expanded



Is there a way to size the Container (or any other widget such as a GestureDetector) to its largest sibling in the stack?


Container


GestureDetector





pub.dartlang.org/packages/after_layout might be able to help you
– Günter Zöchbauer
Jul 2 at 5:40









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

LIteTlYNbjCs nm3dk,d4k npCZB4,PnmBi
DctvI,NS1tBNv,1ju8nM,Yqo Bf93FZPWOf,bmYT7Gy71nyOzaX UqygKWa5yQjwnYQEaf bWtohffDccyGwA01FTMfbmh5U

Popular posts from this blog

Rothschild family

Boo (programming language)