CsBoardLayout class abstract final

The board's grid math, ported from Cloudscape's board components (internal/utils/layout.ts). Pure functions on CsBoardEntry lists; the board widget calls them, and so can tests or app code that needs to add an item at a spot.

Items pack like a skyline: each one, in list order, lands at its stored column (or the first column where it fits without raising the board) and as high as the items above it allow. A layout therefore never has overlaps or holes that items could float into.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

apply<T>(List<CsBoardEntry<T>> items, CsBoardGrid grid, {String? resized, List<CsBoardEntry<T>>? previous}) → List<CsBoardEntry<T>>
Writes grid back into items (Cloudscape transformItems): items come back in reading order with this column count's offset stored. Offsets for other column counts are dropped from the first item whose position changed, so those layouts reflow. resized also takes its spans from the grid.
columnsForWidth(double width) → int
Column count for a board width (Cloudscape useContainerColumns): 1 below 688px, 2 below 912px, 4 below 2100px, else 6.
defaultColumns(CsBoardItemDefinition? d, int columns) → int
defaultRows(CsBoardItemDefinition? d) → int
disturbed(CsBoardGrid before, CsBoardGrid after, {String? except}) → List<String>
Ids of items whose placement differs between before and after.
interpret<T>(List<CsBoardEntry<T>> items, int columns) → CsBoardGrid
Lays out items in columns columns (Cloudscape interpretItems).
minColumns(CsBoardItemDefinition? d, int columns) → int
minRows(CsBoardItemDefinition? d) → int
place<T>(List<CsBoardEntry<T>> items, CsBoardEntry<T> entry, int x, int y, int columns) → List<CsBoardEntry<T>>
items with entry placed at column x, row y in the columns layout. Used for moving an item (entry already in items) and for inserting one (it is not). Other items keep their columns and are pushed down where they would overlap.
remove<T>(List<CsBoardEntry<T>> items, String id, int columns) → List<CsBoardEntry<T>>
items without id; the items below float up.
resize<T>(List<CsBoardEntry<T>> items, String id, int width, int height, int columns) → List<CsBoardEntry<T>>
items with id resized to width columns and height rows in the columns layout, clamped to the item's minimums and to the columns left after its offset.

Constants

minColumnSpan → const int
Smallest column span (Cloudscape MIN_COL_SPAN).
minRowSpan → const int
Smallest row span (Cloudscape MIN_ROW_SPAN).