How Can I display items in gridview in AnimatedList in flutter

39 views Asked by At

I am working on a project where I am fetching results with pagination. I want to use AnimatedList to avoid rebuilding the whole list. However, the problem is that I am using GridView.builder to display my results in a grid. Unfortunately, with AnimatedList, I don't have that option. Is there a way to achieve this?

Container(
      width: width,
      child: GridView.builder(
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
          childAspectRatio: 6/7.5,
          crossAxisSpacing: 10,
          mainAxisSpacing: 10,
        ),
        physics: const NeverScrollableScrollPhysics(),
        shrinkWrap: true,
        padding: const EdgeInsets.all(0),
        itemCount: listingLists.length,
        itemBuilder: (context, index) {
          return listingBlock(width/2, listingLists[index]);
        },
      ),
    ),

0

There are 0 answers