TatsuUkraine/flutter_sticky_infinite_list

GridView or GridSliver as Child

Closed this issue · 6 comments

Hi,

is it possible to add a GridView or a GridSliver as the child of your infiniteList?

Cheers!

Hello.

The problem is that GridView is a scrollable widget (for example InfiniteList widget uses CustomScrollView) and GridSliver is sliver (scroll) item. So overall it's possible, BUT fortunately, it won't be the quite best solution))

What actually you want to achieve? Maybe you can provide a screenshot with an example?

Screenshot_1593817322

I am trying to make an image view where images are sorted by date modified (or any other category) and within this category they are displayed in a grid. The issue I am experiencing with the current library (flutter_sticky_header) is that all the headers are kept in the list which becomes a problem when displaying a lot of images.

so the case here that flutter_sticky_header is focused on a finite list of categories with potentially infinite content within the category. My package, on the other hand, is focused on a potentially infinite list of categories with a finite content within the category.

So if you want to use my package to accomplish your task - you actually not necessarily need GridSliver to build category content. Like, potentially, you can use GridView with shrinkWrap, but I'm not sure if you get any performance benefit from it compared to just using Wrap widget as a category content

Thank you for your suggestion. I will look into it and give it a try.

Your library with the suggested solution uses about 30% less memory, which is good. Performance seems to be a little bit better, however, I have not done extensive comparisons yet.

If I have to guess, I would say your library will perform better in cases where there are a lot of categories with limited amount of content per category whereas flutter_sticky_header will perform better in cases with a limited amount of categories with a lot of content each.

I decided to default to your library since it consumes less memory in my testcase, however, I do intend to perform some more tests in the future.

Thx for your help.

I'm glad it helped) let me know if you get any problems)