bento_layout 0.1.2
bento_layout: ^0.1.2 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.1.0 #
Initial release.
Added #
BentoGrid— drop-in scrollable grid widget powered by the skyline algorithmBentoItem— tile wrapper accepting anyWidgetchild and aBentoItemSizeBentoItemSize— 9-value enum encoding both width and height in a self-documenting name (quarterBar,halfCard,fullToweretc.)BentoDimension— resolved tile dimensions aswidthFraction+heightSpanBentoSizingStrategy— abstract interface for custom size mappingsDefaultBentoSizingStrategy— built-in 3×3 size matrix (quarter/half/full × Bar/Card/Tower)BentoGridDelegate— exportedSliverGridDelegatefor composing the grid into customCustomScrollViewscroll views alongside other slivers
Design decisions #
- Tile widths expressed as fractions of total width — no column count required
- Tile heights use a fixed
unitHeight(default180px) decoupled from width — heights are consistent across all screen sizes - Skyline slot granularity derived automatically from the smallest
widthFractionpresent in the item list - Greedy bin-packing — items are placed at the lowest available position in order, preserving intentional tile sequence