letsar / flutter_staggered_grid_view

A Flutter staggered grid view
MIT License
3.14k stars 510 forks source link

aligned grid with cross axis variation #266

Closed clragon closed 2 years ago

clragon commented 2 years ago

If I have understood correctly, the problem with the staggered grid view is that the tiles may not fill the entire cross axis, and therefore might shift around if new tiles are added which is undesirable. That is why that layout was limited to small item counts.

It would be nice to have a grid view layout in which the items are forced or otherwise guaranteed to always fill the entire cross axis, while also all having the same height in their axis like aligned grid.

This could be achieved by asserting that they add up to an entire axis or by distributing any remaining space between them or by stretching the last one to fill or there might be other ways to do so. This wouldnt replicate the full power of a staggered grid, as no gaps are allowed and item height couldnt exceed the current row it is in, but it would probably be easier to layout and avoid the shifting problem. (I am unsure whether a full staggered grid layout where taking the full cross axis is enforced would be possible.)

Infinite grid layouts like the following seen in the samsung galaxy gallery app could be possible:

image

letsar commented 2 years ago

I'm not sure to understand. Isn't Quilted what you want ?

clragon commented 2 years ago

I think this idea can be realized with just a ListView and alot of math and some complicated kind of algorithm for picking which children go into which row. I will close this issue.