mosaic_grid 0.1.1 copy "mosaic_grid: ^0.1.1" to clipboard
mosaic_grid: ^0.1.1 copied to clipboard

Lazy grids whose tiles size themselves: aligned rows that grow to their tallest card, masonry columns, multi-column tiles, paging and jump-to-item.

Changelog #

0.1.1 #

Fixes #

  • onEndReached fires again when a new page arrives and still does not fill the viewport. Only the first page was checked: with nothing to scroll, no scroll metric changed, no notification came, and the page after it was never asked for.
  • onEndReached no longer stays silent after the list is replaced by another one of the same length, such as the first page of a new search. It fired at most once per itemCount and never re-armed; now scrolling away from the end and back re-arms it.

Added #

  • MosaicGrid.endReachedKey — what the items were loaded for (a search term, a filter). When it changes, the grid forgets that onEndReached already fired and checks the end again: the fix for a list replaced in place while the view stays at the end, which no scroll or change of itemCount reveals.

0.1.0 #

First release.

Layouts #

  • MosaicLayout.rows — tiles fill rows from the start edge, and every row is as tall as its tallest tile. MosaicRowFit decides what shorter tiles do: stretch (the default), start, center or end.
  • MosaicLayout.masonry — every tile keeps its height and drops into the column that ends first.
  • columnSpan — tiles spanning several columns, in both layouts, built lazily.

Columns #

  • MosaicColumns.count, MosaicColumns.minExtent (with an optional maxCount) and MosaicColumns.maxExtent, resolved from the grid's own cross-axis extent on every layout.

Widgets #

  • MosaicGrid — a scroll view with header, footer, onEndReached (at most once per itemCount) and every usual scroll view option.
  • SliverMosaicGrid — the same grid as a sliver, for CustomScrollView.
  • MosaicController — jumpToIndex and animateToIndex, with alignment, exact even for items never built.

Behaviour #

  • Positions come from a ledger recorded in index order from the first item, so scrolling back up never drifts.
  • Tiles already laid out are not laid out again while scrolling; stretched rows need no IntrinsicHeight.
  • A tile above the viewport that changes size does not move the visible content, and neither does a change of column count.
  • Measuring is time-sliced: a long jump (a scrollbar drag, a far jumpTo) fills in over a few frames instead of blocking one.
  • Masonry lookups and re-flows stay logarithmic in the number of items, even when one column runs far longer than the others.
  • Vertical and horizontal scrolling, right-to-left, keep-alives, semantics indexes and keyed reordering.
4
likes
160
points
--
downloads
screenshot

Documentation

API reference

Publisher

verified publisherdevfrs.com

Weekly Downloads

Lazy grids whose tiles size themselves: aligned rows that grow to their tallest card, masonry columns, multi-column tiles, paging and jump-to-item.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#grid #masonry #layout #sliver #widget

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mosaic_grid