towhid
towhid

Reputation: 3298

Combine multiple ListView scroll as one in flutter

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.

Upvotes: 2

Views: 1044

Answers (0)

Related Questions