DimensionProjectionPolicy enum

Defines how an item's dimensions are projected when dragged between grids with different slot counts.

Inheritance
Available extensions

Values

preserveLogicalSize → const DimensionProjectionPolicy

Preserves the absolute logical coordinates/dimensions (e.g., a 2x2 item remains 2x2 in the target grid).

preserveVisualProportion → const DimensionProjectionPolicy

Automatically scales the width proportionally based on the column count ratio between the source and target grids (e.g., a w:2 item in an 8-column grid projects to w:1 in a 4-column grid, keeping its visual percentage of 25% of the screen width). The height is scaled proportionally to preserve the item's aspect ratio relative to slot count.

preservePixelSize → const DimensionProjectionPolicy

Preserves the item's PHYSICAL size: w/h are re-derived from the two grids' live slot strides, so the tile occupies the same pixel span after the move.

This is what preserveVisualProportion is commonly mistaken for. That policy preserves the fraction of its container, which SHRINKS the tile whenever the target container is physically narrower — and a nested panel always is, since it lives inside one cell-range of its parent. Concretely, with a 24-column page 1200 px wide and a panel hosted in a 6-column-wide tile split into 12 columns, a w:4 tile (193 px) projects to:

policy w pixels
preserveLogicalSize 4 87 px
preserveVisualProportion 2 40 px
preservePixelSize 8 193 px

minW/minH are scaled by the same factor, so a touch-target floor (e.g. "at least 120 physical px") keeps its meaning in the denser grid; finite maxW/maxH are scaled too. The result is always sanitized against the target grid, so a tile that cannot physically fit is clamped to the full target width rather than overflowing.

Requires both grids to be laid out. When either sliver is not attached yet, the projection degrades to preserveLogicalSize — the strides are unknown, and guessing would be worse than keeping the logical size.

custom → const DimensionProjectionPolicy

Delegates the projection to a developer-defined custom callback.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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

Constants

values → const List<DimensionProjectionPolicy>
A constant List of the values in this enum, in order of their declaration.