1

I want to nest a ListView inside a ListView.

Here's the code:

return ScrollablePositionedList.builder(
    itemScrollController: itemScrollController,
    itemPositionsListener: itemPositionListener,
    itemCount: widget.favouritesCategories.length,
    itemBuilder: (BuildContext context, int index) {
      return CategoryPublicationList(favouriteCategory: widget.favouritesCategories[index]);
    });

This ListView work fine but

return ListView.builder(
        shrinkWrap: true,
        itemCount: publications.length,
        itemBuilder: (BuildContext context, int index) {
          return PublicationWidget(publication: publications[index]);
      });

Insided ListView don't scroll. Can somebody help me, please?

UI I would like

2 Answers 2

1

If you want to have the inner ListView be scrollable independently of the main scroll view, you should use NestedScrollView.

Please check more info here

Sign up to request clarification or add additional context in comments.

Comments

0

it will not work, only 1 ListView will work, You can use SliverWidget, make a CustomScrollView and within that you can use nested scroll using SliverList.

https://www.woolha.com/tutorials/flutter-customscrollview-with-slivers-examples

3 Comments

A CustomScrollView where inside there is a SliverList and inside this SliverList the inner SliverList?
All SliverWidgets can be used only within CustomScrollView, can you UI what u want to acheive
I've push an image, some idea? It's a list that for each item there is another list when you click

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.