letsar / flutter_staggered_grid_view

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

Masonry flicker when items are of same height #283

Open itsJoKr opened 1 year ago

itsJoKr commented 1 year ago

If I have first two items of same height, it seems that calculation for next item can get either way. So, for example I would get screen A (from screenhost) when opening the screen. And I scroll 10 items down and when I scroll up I get screen B.

Once I start scrolling down it will flicker back to screen A again. It seems that this is bug in the algorithm that's calculating where items go. When first two items are of the same height, the calculation is not always same and can put either one as next item.

My workaround is by adding SizedBox(height: 1) as a first item.

image