flutter_staggered_grid_view icon indicating copy to clipboard operation
flutter_staggered_grid_view copied to clipboard

AlignedGridView grid - rebuild of all visible items on scroll

Open radzish opened this issue 2 years ago • 3 comments
trafficstars

I am using AlignedGridView (with count constructor). I noticed that performance of scrolling is quite poor. While debugging I noticed that when I scroll grid, all visible items are rebuilt.

I replaced AlignedGridView with MasonryGridView and later does not have this issue. As a workaround I implemented item widgets cache, it improved performance dramatically, however I am not sure it is safe/efficient solution.

I am using 0.7.0 version.

radzish avatar Sep 01 '23 13:09 radzish

Mostly it is because AlignedGridView uses SliverLayoutBuilder under the hood. It rebuilds on every scroll change.

r-i-c-o avatar Mar 26 '24 12:03 r-i-c-o

I have same issue, so what solution for this? Using MasonryGridView instead is good @radzish? Thank you so much!

doanngoctu95 avatar May 30 '24 04:05 doanngoctu95

I have same issue, so what solution for this? Using MasonryGridView instead is good @radzish? Thank you so much!

I've switched to MasonryGridView with same settings and all works fine

sedax90 avatar Aug 29 '24 06:08 sedax90