sliver_dashboard
library
Classes
AsyncData <T >
A class that represents a value that is loaded asynchronously.
AsyncError <T >
A class that represents an error that occurred while loading a value.
AsyncIdle <T >
A class that represents an idle state.
AsyncLoading <T >
A class that represents a value that is being loaded asynchronously.
AsyncSingletonRef <T >
A AsyncSingletonRef is a reference with an asynchronous factory/creation
function that always return the same instance.
AsyncTransientRef <T >
A AsyncTransientRef is a reference with an asynchronous
factory/creation function that always return a new instance.
AsyncValue <T >
A class that represents a value that is loaded asynchronously.
It can be in one of the following states:
BeaconController
An abstract mixin class that automatically disposes all beacons created by
this controller.
BeaconFamily <Arg , BeaconType extends ReadableBeacon >
This returns a beacon that is created using the provided create function.
The beacon is cached and returned if the same argument is provided again.
BeaconGroup
An alternative to the global beacon creator ie: Beacon.writable(0); that
keeps track of all beacons and effects created so they can be disposed/reset together.
This is useful when you're creating multiple beacons in a stateful widget or
controller class and want to dispose them together.
BeaconObserver
A class that observes beacons.
BeaconScheduler
Effects are not synchronous, their execution is controlled by a scheduler.
When a dependency of an effect changes, it is added to a queue and
the scheduler decides when is the best time to flush the queue.
By default, the queue is flushed with a DARTVM microtask which runs
on the next loop; this can be changed by setting a custom scheduler.
Flutter comes with its own scheduler, so it is recommended to use
flutter's scheduler when using beacons in a flutter app.
This can be done by calling BeaconScheduler.useFlutterScheduler();
in the main function.
BufferedCountBeacon <T >
A beacon that exposes a buffer of values that have been added to it.
BufferedTimeBeacon <T >
A beacon that exposes a buffer of values that
have been added to it based on a timer.
CompactorDelegate
A strategy delegate for compacting the layout and resolving collisions.
CrossGridDragTarget
The role a DashboardOverlay plays in cross-grid drag & drop.
Dashboard <T extends Object >
The main dashboard widget.
DashboardController
The public contract for the Dashboard Controller.
DashboardControllerProvider
An InheritedWidget that provides a DashboardController to its descendants.
DashboardDelayedDragStartListener
A widget that detects delayed touch gestures (like long press) on its child
and initiates a drag operation on the parent DashboardItem.
DashboardDragStartListener
A widget that detects immediate touch gestures (like pointer down) on its child
and initiates a drag operation on the parent DashboardItem.
DashboardGuidance
A set of customizable messages for user guidance.
DashboardItemStyle
Configuration for the visual appearance of dashboard items.
DashboardItemWrapper
A wrapper for dashboard items that automatically adds resize handles
when the dashboard is in edit mode.
DashboardMinimap
A widget that displays a miniature representation of the dashboard layout
and the current viewport (visible area).
DashboardNestedCoordinator
Coordinates every dashboard living under a DashboardNestedScope :
DashboardNestedScope
Enables nested dashboards and cross-grid drag & drop for every Dashboard
in its subtree.
DashboardOverlay <T extends Object >
A widget that provides interaction capabilities (drag, resize, auto-scroll)
for SliverDashboard s embedded within its child .
DashboardOverlayController
An interface to control DashboardOverlay programmatically.
DashboardOverlayProvider
An InheritedWidget that provides a DashboardOverlayController to its descendants.
DashboardPolicy
A declarative policy interface to validate and customize grid interactions at runtime.
DashboardShortcuts
Configuration for keyboard shortcuts used in the dashboard.
DebouncedBeacon <T >
A beacon that debounces updates to its value.
Disposable
An abstract class that provides a contract for disposing resources.
FastHorizontalCompactor
A high-performance horizontal compactor using the "Rising Tide" (Skyline) algorithm.
Gravity pulls items to the LEFT.
FastVerticalCompactor
A high-performance vertical compactor using the "Rising Tide" (Skyline) algorithm.
Complexity: O(N) roughly, instead of O(N^2).
FilteredBeacon <T >
A beacon that filters updates to its value based on a function.
FutureBeacon <T >
See Beacon.future
GridBackgroundPainter
A custom painter that draws the background grid lines and the highlight
for the currently active item (or placeholder) within a Sliver context.
GridStyle
A class to hold styling properties for the background grid.
HorizontalCompactor
Horizontal compaction (Gravity pulls left).
InteractionGuidance
A class that holds both a MouseCursor and a String message,
representing the guidance for a specific user interaction.
IScopedRef <T >
A ScopedRef is a reference that needs a context to access the instance.
LassoStyle
Behaviour and appearance of the rubberband ("lasso") selection.
LayoutItem
A single, immutable source of truth for a dashboard item's properties.
ListBeacon <E >
A beacon that holds a list of values.
LiteRefScope
Dependency injection of ScopedRef s.
LoggingObserver
A beacon observer that logs to the console.
MapBeacon <K , V >
A beacon that holds a map of values.
MinimapMarker
A custom overlay marker rendered over one item in the DashboardMinimap
(e.g. a status dot, an active-selection badge).
MinimapStyle
Configuration for the visual appearance of the DashboardMinimap.
NestedDashboard <T extends Object >
A dashboard embedded inside an item of another dashboard.
NestedGridData
Serializable payload of one nested grid: its layout and (optionally) its
slot count. Saves the container column for nested grids,
and NestedDashboard.autoSlotCount may override it at
runtime from the host item width.
NestedGridRegistration
A live registration of a grid inside a DashboardNestedScope .
NoCompactor
No compaction (Free movement), but resolves overlaps.
PeriodicBeacon <T >
A beacon that emits values periodically.
Producer <T >
The base class for all beacons.
ProgressBeacon <T >
A beacon that emits values periodically with progress information.
RawStreamBeacon <T >
See: Beacon.rawStream()
ReadableBeacon <T >
An immutable beacon.
Ref
abstract class for creating refs.
RenderSliverDashboard
The render object that implements the sliver grid layout.
ResizeHandleWidget
A widget that displays an "L" shaped, interactive visual indicator for a resize handle.
This widget is designed to be placed in the corner of a Stack.
ScopedFamilyRef <T , F >
A ScopedFamilyRef is a reference that needs a context to access instances.
ScopedObject <T >
A ScopedObject is a reference that holds an instance of T.
ScopedRef <T >
A ScopedRef is a reference that needs a context to access the instance.
SetBeacon <E >
A beacon that holds a set of values.
SingletonRef <T >
A SingletonRef is a reference that always returns a new instance.
SliverDashboard
A sliver that displays the dashboard grid.
SliverDashboardLayout
A low-level sliver that displays a grid of items based on the dashboard layout.
SliverDashboardParentData
Custom parent data for children of RenderSliverDashboard .
StreamBeacon <T >
See: Beacon.stream()
TextEditingBeacon
A beacon that wraps a TextEditingController .
ThrottledBeacon <T >
A beacon that throttles updates to its value.
TimestampBeacon <T >
A beacon that attaches a timestamp to its value.
TransientRef <T >
A TransientRef is a reference that always return a new instance.
TrashLayout
Defines the layout and animation behavior of the Trash bin.
It contains both the visible position (when dragging) and the hidden position.
TrashPosition
Defines the position of the Trash bin in the Stack.
UndoRedoBeacon <T >
A beacon that allows undo/redo operations.
VerticalCompactor
Default vertical compaction (Gravity pulls up).
ViewportIndicator
Configuration of one viewport indicator painted by the DashboardMinimap.
WritableBeacon <T >
A beacon that can be written to.
Constants
Beacon
→ const _BeaconCreator
Global beacon creator
Properties
debugBypassCloneIdAssert
↔ bool
Internal flag to allow bypassing the clone-id assertion during unit
tests, so the defensive release-mode path (reject the duplicate id and
fall back to a plain move) is reachable and covered.
getter/setter pair
debugOverrideIsWeb
↔ bool
Internal flag to allow overriding kIsWeb during unit tests
to safely execute and cover the Web throttle mechanism.
getter/setter pair
debugThrottleClock
↔ Duration Function() ?
Test hook: injectable time source for the pointer-throttle gate. When
null (production), real elapsed time from an internal Stopwatch is
used. Tests provide a controlled Duration so the gate is DETERMINISTIC:
the real clock made the throttle untestable — coverage instrumentation
and suite load stretch the delay between two synthetic pointer events
past the 16 ms window, flipping the observed behavior between isolated
and full-suite runs.
getter/setter pair
Functions
bottom (Layout layout )
→ int
Returns the bottom-most coordinate of the layout.
calculateBoundingBox (List <LayoutItem > items , {String ? id })
→ LayoutItem
Calculates the bounding box of a group of items.
Returns a virtual LayoutItem that encompasses all items.
calculateResizeHandle ({required Offset localPosition , required Size size , required double handleSide , required bool isResizable })
→ ResizeHandle ?
Utility to calculate which handle is at the given local position.
collides (LayoutItem l1 , LayoutItem l2 )
→ bool
Checks if two layout items collide.
compact (List <LayoutItem > layout , CompactType compactType , int cols , {bool allowOverlap = false })
→ List <LayoutItem >
Compacts the layout.
compactItem (List <LayoutItem > compareWith , LayoutItem l , CompactType compactType , int cols , List <LayoutItem > fullLayout )
→ LayoutItem
Compact a single item within the layout.
correctBounds (Layout layout , int cols )
→ Layout
Corrects the bounds of the layout items to ensure they fit within the
specified number of columns.
exportNestedTree (DashboardNestedCoordinator coordinator , DashboardController root )
→ List <Map <String , dynamic > >
Recursive serialization of a nested dashboard tree.
getAllCollisions (Layout layout , LayoutItem layoutItem )
→ List <LayoutItem >
Gets all items in the layout that collide with the given item.
getFirstCollision (Layout layout , LayoutItem layoutItem )
→ LayoutItem ?
Gets the first item in the layout that collides with the given item.
getStatics (Layout layout )
→ List <LayoutItem >
Returns a list of all static items in the layout.
loadNestedTree (DashboardNestedCoordinator coordinator , DashboardController root , List tree )
→ void
Loads a tree produced by exportNestedTree into root.
mapEquals <T , U > (Map <T , U > ? a , Map <T , U > ? b )
→ bool
Imported from foundation package
Compares two maps for element-by-element equality.
mapViewportToSegment ({required double pixels , required double viewportDimension , required double segmentLeading , required double segmentExtent , required double minimapMainAxis })
→ (double , double )?
Maps the scrollable's visible window onto a minimap of one scroll
segment. Returns (indicatorStart, indicatorLength) in minimap logical
pixels, or null when nothing of the segment is visible.
minimapItemRect (LayoutItem item , {required double scale , required double unitWidth , required double unitHeight , required double spacingRatioMain , required double spacingRatioCross , required bool isVertical })
→ Rect
Paints the custom overlay markers in an isolated cached layer.
moveCluster (Layout layout , Set <String > clusterIds , int targetX , int targetY , {required int cols , required CompactType compactType , bool preventCollision = false , DashboardPolicy ? policy , bool allowAutoShrink = false })
→ Layout
Moves a group of items (cluster) together.
moveElement (Layout layout , LayoutItem l , int ? x , int ? y , {required int cols , required CompactType compactType , bool isUserAction = false , bool preventCollision = false , bool force = false , DashboardPolicy ? policy })
→ Layout
Moves a single layout item l to the target grid coordinates (x, y).
Returns a new, mutated, and ID-stabilized Layout containing the updated coordinates.
optimizeLayout (List <LayoutItem > layout , int columns )
→ Layout
Optimizes the layout by compacting items to remove gaps,
respecting the visual order (top-left to bottom-right).
Static items act as obstacles and are not moved.
placeNewItems ({required List <LayoutItem > existingLayout , required List <LayoutItem > newItems , required int cols , AutoPlacementStrategy strategy = AutoPlacementStrategy.appendBottom , int ? maxRows })
→ List <LayoutItem >
Calculates valid positions for new items (where x or y is -1) by appending them
to the bottom of the existing layout.
resizeItem (Layout layout , LayoutItem itemToResize , {required ResizeBehavior behavior , required int cols , bool preventCollision = false , CompactType compactType = CompactType.vertical , DashboardPolicy ? policy })
→ Layout
Resize item. Implements the "try shrink, fallback to push" logic.
resolveCollisions (List <LayoutItem > layout , CompactType compactType , {int ? cols })
→ List <LayoutItem >
Resolves collisions.
resolveCompactionCollision (Layout layout , LayoutItem item , int moveToCoord , String axis )
→ LayoutItem
Recursively resolves collisions during compaction by moving items down/right.
Exposed for custom compactors.
sortLayoutItems (Layout layout , CompactType compactType )
→ List <LayoutItem >
Sorts layout items based on the compaction type.
swapElements (Layout layout , LayoutItem moving , int targetX , int targetY , {required int cols , required CompactType compactType , DashboardPolicy ? policy , double coverageThreshold = 0.5 })
→ Layout ?
Exchanges the position of moving with the item it is landing on.
Typedefs
A11yCountMessageBuilder
= String Function(int count )
Builder for accessibility messages carrying a plain count, such as the
number of items a rubberband ("lasso") selection ended up covering.
A11yItemMessageBuilder
= String Function(String itemId )
Builder for accessibility messages related to an item ID.
A11yPositionMessageBuilder
= String Function(int x , int y )
Builder for accessibility messages related to a grid position.
AsyncFactory <T >
= Future <T > Function()
A function that creates an instance of T asynchronousloy.
BaseBeacon <T >
= Producer <T >
The BaseBeacon type. Alias for Producer.
BeaconSelector <T , C >
= ReadableBeacon <T > Function(C )
A function that takes a BeaconController and returns 1 of its beacon.
BeaconSelector2 <T1 , T2 , C >
= (ReadableBeacon <T1 > , ReadableBeacon <T2 > ) Function(C )
A function that takes a BeaconController and
returns a record of 2 of its beacons.
BeaconSelector3 <T1 , T2 , T3 , C >
= (ReadableBeacon <T1 > , ReadableBeacon <T2 > , ReadableBeacon <T3 > ) Function(C )
A function that takes a BeaconController and
returns a record of 3 of its beacons.
CtxCreateFn <T >
= T Function(BuildContext context )
The function used to create an instance of T.
CtxFamilyCreateFn <T , F >
= T Function(BuildContext context , F family )
The function used to create an instance of T with a family F.
DashboardBreakpointResolver
= dynamic Function(double width , double height , LayoutItem item , int slotCount )
Maps physical dimensions to a developer-defined custom breakpoint state.
DashboardCanAcceptItemCallback
= bool Function(LayoutItem item , DashboardController targetGrid , DashboardController sourceGrid )
Decides whether item, currently being dragged out of sourceGrid, may
land in targetGrid.
DashboardCloneRequestCallback
= LayoutItem ? Function(LayoutItem source , DashboardController grid )
Signature for the callback that produces the duplicate of source when a
drag starts with the clone modifier held (Alt / Option by default, see
DashboardShortcuts.cloneKeys).
DashboardDropCallback <T >
= FutureOr <String ? > Function(T data , LayoutItem item )
A callback for onDrop which provides T data and the LayoutItem
DashboardExternalTemplateBuilder <T >
= LayoutItem ? Function(T data )
Resolves the template LayoutItem an external draggable payload of type T will become.
DashboardHistoryRestoreListener
= void Function(List <LayoutItem > restoredLayout , int slotCount )
A callback fired after an undo or a redo restored a layout.
DashboardHistoryVeto
= FutureOr <bool > Function(List <LayoutItem > candidateLayout )
A veto hook consulted before an undo or a redo is applied.
DashboardItemBreakpointBuilder
= Widget Function(BuildContext context , LayoutItem item , dynamic breakpoint , double width , double height , int slotCount )
A responsive builder that reconstructs the child subtree ONLY when the resolved breakpoint transitions.
DashboardItemBuilder
= Widget Function(BuildContext context , LayoutItem item )
A static builder function for dashboard items (optimized; skips rebuilds on resize).
DashboardItemDroppedOnHostCallback
= void Function(List <LayoutItem > draggedItems , LayoutItem host , DashboardController hostGrid , DashboardController sourceGrid )
Signature for DashboardNestedCoordinator.onItemDroppedOnHost : the
dragged items were released over a tile acting as a DROP TARGET (a closed
nested host, or an item flagged isDropTarget).
DashboardItemFeedbackBuilder
= Widget Function(BuildContext context , LayoutItem item , Widget child )
A builder for the item feedback (the widget that follows the finger).
child is the standard widget built by itemBuilder.
DashboardItemInteractionCallback
= void Function(LayoutItem item )
A callback that is fired when a user starts a drag or resize interaction
on a dashboard item.
DashboardItemLayoutBuilder
= Widget Function(BuildContext context , LayoutItem item , double width , double height , int slotCount )
Alternative builder providing live physical pixel dimensions (rebuilds continuously on resize).
DashboardItemMovedToGridCallback
= void Function(LayoutItem item , DashboardController from , DashboardController to )
Signature for the callback fired when an item has been moved from one
grid to another (cross-grid drag & drop, or DashboardNestedCoordinator.moveItemToGrid ).
DashboardItemsDeletedCallback
= void Function(List <LayoutItem > items )
A callback fired when items are deleted.
DashboardLayoutChangeListener
= void Function(List <LayoutItem > restoredLayout , int slotCount )
A callback that is fired when the layout of the dashboard changes.
DashboardNestedGridAbandonedCallback
= void Function(LayoutItem host , DashboardController hostGridController )
Signature for the callback fired when a nested-grid request (see
DashboardNestedCoordinator.onNestedGridRequested ) is abandoned: the
request fired, but the drag ended without the dragged item landing in the
child grid of host — dropped elsewhere, returned to its origin, or
canceled. Lets the application revert a speculative conversion (e.g. an
empty panel created in response to the request).
DashboardNestedGridRequestCallback
= void Function(LayoutItem host , LayoutItem dragged , DashboardController hostGridController )
Signature for the callback fired when the user holds a dragged item over a
plain (non-nested) item for DashboardNestedScope.nestHoverDelay while
DashboardNestedScope.subGridDynamic is enabled.
A builder function for rendering custom section headers.
DashboardTrashBuilder
= Widget Function(BuildContext context , bool isHovered , bool isActive , String ? activeItemId )
A builder for the trash/delete area.
isHovered is true if the dragged item is currently over the trash area.
isActive is true if the item has been hovered long enough to trigger deletion on drop.
DashboardWillDeleteCallback
= Future <bool > Function(List <LayoutItem > items )
A callback to confirm the deletion of multiple items.
Returns true to proceed with deletion, false to cancel.
DimensionProjectionCallback
= LayoutItem Function(LayoutItem item , {required int sourceSlotCount , required int targetSlotCount })
Callback signature for custom item dimension projection when dragging across asymmetrical grids.
DisposeFn <T >
= void Function(T )
The function called when the IScopedRef is disposed.
DraggableDataBuilder <T >
= T Function()
A builder for the data that is dropped onto the dashboard.
DraggableFeedbackBuilder
= Widget Function(BuildContext context )
A builder for the widget that is dragged from an external source.
Layout
= List <LayoutItem >
A list of LayoutItem s representing the entire grid layout.
LayoutProfileCallback
= void Function(Duration duration )
A callback for profiling layout performance.
duration is the time taken for performLayout.
ObserverCallback <T >
= void Function(T prev , T next )