DashboardNestedScope class

Enables nested dashboards and cross-grid drag & drop for every Dashboard in its subtree.

Wrap the common ancestor of all related dashboards (typically above the root Dashboard) — nested NestedDashboard's register automatically:

DashboardNestedScope(
  onItemMovedToGrid: (item, from, to) => save(),
  child: Dashboard(controller: root, itemBuilder: buildItem),
)

Without this scope, dashboards behave exactly as before: the nested layer adds zero work to single-grid setups.

Inheritance

Constructors

DashboardNestedScope({required Widget child, Key? key, DashboardNestedCoordinator? coordinator, DashboardItemMovedToGridCallback? onItemMovedToGrid, DashboardNestedGridRequestCallback? onNestedGridRequested, DashboardNestedGridAbandonedCallback? onNestedGridRequestAbandoned, DashboardItemDroppedOnHostCallback? onItemDroppedOnHost, DashboardCloneRequestCallback? onCloneRequested, bool subGridDynamic = false, bool subGridDynamicSameGrid = false, Duration nestHoverDelay = const Duration(milliseconds: 600), CrossGridProbe probe = CrossGridProbe.pointer, int? maxNestingDepth, DimensionProjectionPolicy projectionPolicy = DimensionProjectionPolicy.preserveLogicalSize, DimensionProjectionCallback? customProjectionCallback, double hoverJitterTolerance = 4.0, DashboardCanAcceptItemCallback? canAcceptItem})
Creates a scope enabling cross-grid interactions for its subtree.
const

Properties

canAcceptItem → DashboardCanAcceptItemCallback?
Business filter deciding which items each grid of the tree accepts.
final
child → Widget
The subtree containing the dashboards.
final
coordinator → DashboardNestedCoordinator?
Optional externally-owned coordinator (for testing or advanced setups). When null, the scope creates and owns one.
final
customProjectionCallback → DimensionProjectionCallback?
A custom callback to project item dimensions when projectionPolicy is set to DimensionProjectionPolicy.custom.
final
hashCode → int
The hash code for this object.
no setterinherited
hoverJitterTolerance → double
Low-pass jitter filter for nest-hover host switching. See DashboardNestedCoordinator.hoverJitterTolerance.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxNestingDepth → int?
Maximum nesting depth, or null (default) for no limit.
final
nestHoverDelay → Duration
Hover duration before onNestedGridRequested fires.
final
onCloneRequested → DashboardCloneRequestCallback?
Scope-wide default producing the duplicate of a tile dragged with the clone modifier held. A per-grid Dashboard.onCloneRequested / DashboardOverlay.onCloneRequested overrides it. See DashboardNestedCoordinator.onCloneRequested.
final
onItemDroppedOnHost → DashboardItemDroppedOnHostCallback?
Scope-wide default fired when dragged items are released over a drop-target tile (closed nested host, or isDropTarget item). See DashboardNestedCoordinator.onItemDroppedOnHost.
final
onItemMovedToGrid → DashboardItemMovedToGridCallback?
Fired after every successful cross-grid move.
final
onNestedGridRequestAbandoned → DashboardNestedGridAbandonedCallback?
Fired when a nested-grid request is abandoned (drag ended without dropping into the requested host's child grid). See DashboardNestedCoordinator.onNestedGridRequestAbandoned.
final
onNestedGridRequested → DashboardNestedGridRequestCallback?
Fired when a dynamic nested grid is requested (see subGridDynamic).
final
probe → CrossGridProbe
Which point decides the grid under a cross-grid drag (pointer — default — or the dragged tile's center).
final
projectionPolicy → DimensionProjectionPolicy
The active dimension projection policy when dragging across asymmetrical grids.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subGridDynamic → bool
Enables subGridDynamic behavior: holding a dragged item over a plain item arms a request to convert it into a nested grid.
final
subGridDynamicSameGrid → bool
Extends subGridDynamic to same-grid drags: pausing the pointer during an in-grid drag freezes the pushes and arms the hovered sibling. See DashboardNestedCoordinator.subGridDynamicSameGrid. Default: false.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<DashboardNestedScope>
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

Static Methods

maybeOf(BuildContext context) → DashboardNestedCoordinator?
The coordinator of the nearest enclosing scope, or null.