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< items, CsBoardGrid grid, {String? resized, List<T> >CsBoardEntry< ? previous}) → List<T> >CsBoardEntry< T> > -
Writes
gridback intoitems(CloudscapetransformItems): 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.resizedalso takes its spans from the grid. -
columnsForWidth(
double width) → int -
Column count for a board
width(CloudscapeuseContainerColumns): 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
beforeandafter. -
interpret<
T> (List< CsBoardEntry< items, int columns) → CsBoardGridT> > -
Lays out
itemsincolumnscolumns (CloudscapeinterpretItems). -
minColumns(
CsBoardItemDefinition? d, int columns) → int -
minRows(
CsBoardItemDefinition? d) → int -
place<
T> (List< CsBoardEntry< items, CsBoardEntry<T> >T> entry, int x, int y, int columns) → List<CsBoardEntry< T> > -
itemswithentryplaced at columnx, rowyin thecolumnslayout. Used for moving an item (entryalready initems) and for inserting one (it is not). Other items keep their columns and are pushed down where they would overlap. -
remove<
T> (List< CsBoardEntry< items, String id, int columns) → List<T> >CsBoardEntry< T> > -
itemswithoutid; the items below float up. -
resize<
T> (List< CsBoardEntry< items, String id, int width, int height, int columns) → List<T> >CsBoardEntry< T> > -
itemswithidresized towidthcolumns andheightrows in thecolumnslayout, 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).