CsBoard<T> class

Cloudscape's Board: a configurable dashboard grid whose items people rearrange by dragging, resize from the corner, add from a CsItemsPalette and remove.

The board is controlled: it never changes items itself. Every commit calls onItemsChange with the new list, which you store and pass back.

Columns follow the board's own width (1 below 688px, 2 below 912px, 4 below 2100px, else 6), each layout keeping its own arrangement. Rows are 96px apart from a 20px gap (76px and 16px in compact density).

Pointer: drag an item by its handle; it follows the finger 1:1, the others make room, and on release it settles into its slot. Drag the corner handle to resize. Keyboard: focus a handle, press Enter or Space, use the arrow keys, then Enter or Space to commit or Escape to discard.

CsBoard<String>(
  items: items,
  onItemsChange: (change) => setState(() => items = change.items),
  renderItem: (context, item, actions) => CsBoardItem(
    header: CsHeader(title: item.data),
    child: const Text('No alarms'),
  ),
  empty: const Text('No widgets'),
)
Inheritance

Constructors

CsBoard({Key? key, required List<CsBoardEntry<T>> items, required CsBoardItemBuilder<T> renderItem, required ValueChanged<CsBoardItemsChange<T>> onItemsChange, Widget? empty, CsBoardI18nStrings<T>? i18nStrings, int? columns})
const

Properties

columns → int?
Forces a column count (1, 2, 4 or 6) instead of following the width.
final
empty → Widget?
Shown when items is empty (and as the loading slot while items load).
final
hashCode → int
The hash code for this object.
no setterinherited
i18nStrings → CsBoardI18nStrings<T>?
final
items → List<CsBoardEntry<T>>
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onItemsChange → ValueChanged<CsBoardItemsChange<T>>
final
renderItem → CsBoardItemBuilder<T>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<CsBoard<T>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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

Constants

compactGap → const double
compactRowHeight → const double
Row height and gap for compact density (.grid-compact).
gap → const double
rowHeight → const double
Row height and gap for comfortable density (grid-auto-rows: 96px; gap: 20px in the grid SCSS).
transitionDuration → const Duration
Cloudscape TRANSITION_DURATION_MS.