2

I have a simple ListView with a scrollable child, which works as it should. But the issue is, when I scroll the items of ScrollableChild and it reaches its last child, it doesn't scroll the parent ListView. How can I achieve this behaviour?

ListView(children: [
    ...items(5),
    ScrollableChild(),
    ...items(30),
  ])

I have tried to use the NestedScrollableWidget but unable to find any working solution.

Sample Code

I've tried to use the CustomScrollView, but unfortunately, the result is the same.

CustomScrollView(slivers: [
    SliverList(delegate: SliverChildListDelegate(items(5))),
    SliverToBoxAdapter(child: ScrollableChild()),
    SliverList(delegate: SliverChildListDelegate(items(50))),
  ]),

Sample Code

The expected behavior can be viewed in this [Video]. the code I have shared works fine in a browser without any issue if you scroll it using the mouse wheel only. When the blue child items scroll reaches at the end. it just scrolls the parent, that's what I am looking for.

10
  • 2
    use CustomScrollView with multiple SliverLists as slivers: Commented May 15, 2021 at 7:12
  • I am avoiding CustomScrollView. any other solution brother? Commented May 15, 2021 at 7:19
  • no, no any other solutions Commented May 15, 2021 at 7:20
  • consider using .map... i have achieved something like this with that Commented May 15, 2021 at 7:22
  • 1
    CustomScrollView(slivers: [SliverList(...), SliverList(...), SliverList(...)]) Commented May 15, 2021 at 7:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.