letsar / flutter_staggered_grid_view

A Flutter staggered grid view
MIT License
3.12k stars 508 forks source link

There is a bug in SliverQuiltedGridDelegate #323

Closed Reza-Babakhani closed 11 months ago

Reza-Babakhani commented 11 months ago

this is my code:

GridView.custom(
                shrinkWrap: true,
                physics: const NeverScrollableScrollPhysics(),
                gridDelegate: SliverQuiltedGridDelegate(
                  crossAxisCount: 4,
                  mainAxisSpacing: 15,
                  crossAxisSpacing: 15,
                  repeatPattern: QuiltedGridRepeatPattern.same,
                  pattern: const [
                    QuiltedGridTile(1, 2),
                    QuiltedGridTile(1, 1),
                    QuiltedGridTile(1, 2),
                    QuiltedGridTile(1, 1),
                  ],
                ),
                childrenDelegate: SliverChildBuilderDelegate(
                  (context, index) => RegionListItem(),
                  childCount: 12,
                ),
              ),

I get this error: RangeError (RangeError (index): Invalid value: Not in inclusive range 0..3: 4)