bento_layout 0.2.0 copy "bento_layout: ^0.2.0" to clipboard
bento_layout: ^0.2.0 copied to clipboard

A Flutter package for building bento-style grid layouts using the skyline bin-packing algorithm. Tiles of varying sizes are packed without overlap or unnecessary gaps. Width fills the parent; height i [...]

Changelog #

All notable changes to this package are documented here. This project adheres to Semantic Versioning. #

0.2.0 #

Added #

  • Exported SkylinePacking, BentoLayoutDetails, and BentoGridLayout — consumers can now call SkylinePacking.pack() directly to compute tile geometry and position children in a Stack or custom layout, without going through SliverGrid
  • TileEdge class and sortedEdges on BentoLayoutDetails — pre-sorted tile vertical spans for efficient scroll-offset lookups
  • BentoGridLayout now uses O(log n) binary search for getMinChildIndexForScrollOffset and getMaxChildIndexForScrollOffset instead of returning the full item range — only visible tiles are built during scroll when using SliverGrid

Fixed #

  • BentoGridLayout.getMinChildIndexForScrollOffset and getMaxChildIndexForScrollOffset previously returned 0 and length - 1 for all scroll offsets, causing Flutter to build every tile on every scroll frame regardless of visibility

0.1.2 #

Changed #

  • Updated demo GIFs links in README

0.1.1 #

Changed #

  • Updated README with example screenshots and demo GIFs

0.1.0 #

Initial release.

Added #

  • BentoGrid — drop-in scrollable grid widget powered by the skyline algorithm
  • BentoItem — tile wrapper accepting any Widget child and a BentoItemSize
  • BentoItemSize — 9-value enum encoding both width and height in a self-documenting name (quarterBar, halfCard, fullTower etc.)
  • BentoDimension — resolved tile dimensions as widthFraction + heightSpan
  • BentoSizingStrategy — abstract interface for custom size mappings
  • DefaultBentoSizingStrategy — built-in 3×3 size matrix (quarter/half/full × Bar/Card/Tower)
  • BentoGridDelegate — exported SliverGridDelegate for composing the grid into custom CustomScrollView scroll views alongside other slivers

Design decisions #

  • Tile widths expressed as fractions of total width — no column count required
  • Tile heights use a fixed unitHeight (default 180px) decoupled from width — heights are consistent across all screen sizes
  • Skyline slot granularity derived automatically from the smallest widthFraction present in the item list
  • Greedy bin-packing — items are placed at the lowest available position in order, preserving intentional tile sequence
1
likes
150
points
40
downloads

Documentation

API reference

Publisher

verified publisherbuiltbysid.dev

Weekly Downloads

A Flutter package for building bento-style grid layouts using the skyline bin-packing algorithm. Tiles of varying sizes are packed without overlap or unnecessary gaps. Width fills the parent; height is stable across screen sizes.

Repository (GitHub)
View/report issues

Topics

#layout #grid #ui #bento

License

MIT (license)

Dependencies

flutter

More

Packages that depend on bento_layout