So, I passed the padding of the StaggeredGridView element manually, checking the index in the itemBuilder method, but there is a wrong index order. Starting from the 3rd index, the order is different, and after some scrolling there will be indices with other order.
Indexes:
After some scroll:
I can't use padding and axis spaces of staggered grid view for avoid leading and trailing white spaces of top horizontal categories list view. How to solve that a problem?
Thanks in advance!
Assuming you are using the flutter_staggered_grid_view
package. Staggered grid view doesn't order items from left to right and then vertically. Within a "row" of items, the one further up than the other will be first in order of indexes.
Check out the package documentation. There's a pretty self explanatory image there.