ex:
return SingleChildScrollView(
child: Column(
children: [
w1,
w2,
Wrap(
children: [
c1,
c2,
],
),
],
),
);
It works fine when the screen is lower than the width of these items.
But when it’s not, I want to separate the scroll bar of c1 and c2.
Can I do this without using a responsive widget like LayoutBuilder
or using the height of other items (w1 and w2)?
I tried to wrap the SingleChildScrollView
of each item in the Wrap
, but it did not help.
return SingleChildScrollView(
child: Column(
children: [
w1,
w2,
Expanded(
child: Wrap(
children: [
SingleChildScrollView(child: c1),
SingleChildScrollView(child: c2),
],
),
),
],
),
);
2
Answers
Just put
SingleChildScrollView
intoContainer
withfixed height
.So, your code will be like below: