Flutter: ListView inside ListView don't scroll

277

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

Share:
277
Dani Herrero
Author by

Dani Herrero

Updated on December 21, 2022

Comments

  • Dani Herrero
    Dani Herrero over 1 year

    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

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