sliver_tools
sliver_tools copied to clipboard
MultiCrossAxisSliver
Hey, thanks for this great package!
I have a vertically scrolling MultiSliver. In wide layouts, I want two of the slivers in the MultiSliver to be arranged horizontally. I initially added them as a standard Row(), but that won't work since each child is a sliver. Is there already a way to do that with this package? If not, would there be any interest in adding something like "SliverRow"/"SliverFlex"? Or maybe something like "CrossAxisMultiSliver"?
Hey @doppio sorry for the late response.
I did already have MultiCrossAxisSliver
on the roadmap but haven't had time to implement or flesh out the idea.
A major open question for me would be, how do we determine the cross axis size of the widget since slivers assume to take op the whole cross axis.
If you have any ideas or interest in making a PR let me know!
We could have a CrossAxisFlexibleSliver
with a flex
property which indicates how much space it should take along the cross axis (just like Flexible
for Flex
).
If a child sliver must fill the cross axis space then a child could simply have a default flex value of 1
if not precised by a CrossAxisFlexibleSliver
.
Hi!
First thanks @Kavantix for your work!
I am trying to create SliverStack
containing an horizontal SingleChildScrollView
and a vertical CustomScrollView
.
SliverStack(
positionedAlignment: Alignment.topCenter,
children: [
CustomScrollView(...),
SliverPositioned(
top: 10,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [...],
)
),
],
);
My problem is that horizontal scrolling is not working (i.e scrolling) anymore when using the SliverStack
.
It is like my Gesture is absorbed by the widget below/under and only the vertical scroll is handled.
I tried to put my SingleChildScrollView
in a basic SliverToBoxAdapter
before the SliverStack
, and it works perfectly...
I do not know if it is an expected (not supported yet) behavior or if I am doing something wrong. Does anyone has any hint/tips or tricks?
Thanks ! :smile: