flutter_staggered_grid_view icon indicating copy to clipboard operation
flutter_staggered_grid_view copied to clipboard

[QuiltedGridTile] RangeError (index): Invalid value: Not in inclusive range 0..2: 3

Open bounty1342 opened this issue 4 years ago • 5 comments

Hi,

Just teste the last version 0.6.0 and find what look like an issue.

With a crossAxisCount of 3

 pattern: <QuiltedGridTile>[
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(2, 2),
                    ]

produce an out of bound error.

Where the following pattern does not :

 pattern: <QuiltedGridTile>[
                      const QuiltedGridTile(2, 2),
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(1, 1),
                    ]

Regards

bounty1342 avatar Jan 02 '22 23:01 bounty1342

pattern:  <QuiltedGridTile>[
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(2, 2),
                      const QuiltedGridTile(1, 1),
                    ],

does produce the opposite of the first one.

bounty1342 avatar Jan 03 '22 08:01 bounty1342

Hi

The pattern

 pattern: <QuiltedGridTile>[
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(2, 2),
                    ]

cannot fit into 3 columns, that's why there is an error. I should probably make the error more explicit nonetheless.

letsar avatar Jan 03 '22 12:01 letsar

Hi

The pattern

 pattern: <QuiltedGridTile>[
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(1, 1),
                      const QuiltedGridTile(2, 2),
                    ]

cannot fit into 3 columns, that's why there is an error. I should probably make the error more explicit nonetheless.

how use with n columns? I have this problem in my app and using Staired tile the behaviour not work as expected due indexes (is not sequential)

felipecastrosales avatar Mar 07 '24 15:03 felipecastrosales

I need use QuiltedGridTile sequentially, today is:

0 1 2
5 4 3 
6 7 8

I need:

0 1 2
3 4 5
6 7 8

Is possible make this (use indexes as expected) with SliverWovenGridDelegate, but SliverWovenGridDelegate doesn't supports N columns.

@letsar if you have any recommendations, please put below.

felipecastrosales avatar Mar 07 '24 16:03 felipecastrosales

@letsar I use countBuilder as proposed in this pr:

  • https://github.com/letsar/flutter_staggered_grid_view/pull/316

And works as expected. I think that this PR can be merged, because can help a lot and improve this package. thanks :) 👍

felipecastrosales avatar Mar 07 '24 19:03 felipecastrosales