Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
647 views
in Technique[技术] by (71.8m points)

flutter - Need a workaround for Indexedstack always being as big as the largest child

I have an indexed stack. First child widget has half the content that the second child widget has, but the first child widget's height is the same as the second child widget. This seems to be the expected result due to the design but its annoying because when I scroll on the first child widget, there is a bunch of extra space at the bottom. How can I work around this?

Why did the Flutter team even design it like this? Why not give the widget children the height according the the widgets, not according to whatever the largest child is?

question from:https://stackoverflow.com/questions/65868726/need-a-workaround-for-indexedstack-always-being-as-big-as-the-largest-child

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Co ask. I am experiencing this problem when I have the index stack as one of the slivers in a custom scroll view. The children are wash scrollable lists. So when one child of the indexed stack has more items in its list than the other, there is extra white space at the bottom


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...