Skip to content

v0.8.0-dev.3

Pre-release
Pre-release

Choose a tag to compare

@letsar letsar released this 04 Nov 17:19
4a05682

Third pre-release of 0.8.0, with three new options for the layouts. Please try it and report any issue before the stable 0.8.0.

dependencies:
  flutter_staggered_grid_view: ^0.8.0-dev.3

New

  • Full span children in masonry grids (#337): with isFullSpan, some children of a MasonryGridView or a SliverMasonryGrid span the whole width of the grid, like a banner or a section header. They start below all the columns, and the columns are aligned after them.

    MasonryGridView.count(
      crossAxisCount: 2,
      itemCount: items.length,
      isFullSpan: (index) => items[index] is Ad,
      itemBuilder: (context, index) => ...,
    );
  • Sparse placement of StaggeredGrid (#284): with placement: StaggeredGridPlacement.sparse, each tile is placed after the previous one, so the tiles appear in their order, instead of filling the holes left before previous tiles (the default, dense).

  • alternateDirections on SliverStairedGridDelegate (#261, thanks to whynot-dev for #357): with false, all the tracks of a staired grid are placed in the same direction (a 'Z' sequence) instead of going back and forth.

The example app has an option for each of them, in the app bar of the Masonry, Staggered and Staired pages.

Fixes

  • Children of a masonry grid could lose their state when a child moved with a key left a hole just before the visible children.

Changes

  • SliverMasonryGridParentData.crossAxisIndex is null for the children spanning the whole cross axis.

The package still supports Flutter 3.16 and later. See the CHANGELOG for the details.