BeuiDock class

A dock — the Flutter port of beUI's dock.

By default this is a one-to-one port of the React source (components/motion/dock.tsx): a flat glass bar (items-end, rounded-2xl, a translucent card surface) of fixed-size items, whose only motion is a gliding active pill behind the active item. The pill is a single element that springs between items with beuiSpringLayout when the active item changes (the source's layoutId shared-layout glide) — not a per-item highlight that toggles on/off. The source has no magnification and no pointer tracking, so the default dock has neither: no MouseRegion, no per-item scale, items stay at size.

magnify is a Flutter-only enhancement — it is NOT present in the React source. Setting magnify: true opts into a macOS-style magnifying dock on top of the faithful base: as the pointer moves across the bar, each item scales by its horizontal distance to the cursor and lifts so the bar's baseline stays put.

Distance → scale (only when magnify is true). For item centre cx and cursor x, with d = |x - cx|:

t     = max(0, 1 - d / falloff)      // 1 under the cursor → 0 past falloff
scale = 1 + (maxScale - 1) * t       // 1 → maxScale

falloff is two item-widths, so a small cluster grows like macOS. Each item's scale is spring-smoothed with beuiSpringMouse — the source's continuous cursor-follow token (the same one tilt-card / magnetic use), re-targeted on every MouseRegion.onHover. On exit all items relax to 1.

Grouping. A BeuiDockItem.separator entry renders the source's DockSeparator — a 1px vertical rule that splits the bar into groups. It is decorative throughout: never magnified, never focusable, never active, and hidden from semantics.

Hover-only. Magnification is driven by MouseRegion, so it never fires on touch (matching the source's useHoverCapable() gate). Reduced motion renders the static faithful dock even when magnify is true (no magnification, no lift) and snaps the pill instead of gliding. Colours come from BeuiColors; nothing is hardcoded.

Inheritance

Constructors

BeuiDock({required List<BeuiDockItem> items, bool magnify = false, double size = 44, double maxScale = 1.6, double gap = 6, Key? key})
Creates a dock from items.
const

Properties

gap double
Horizontal gap (px) between items.
final
hashCode int
The hash code for this object.
no setterinherited
items List<BeuiDockItem>
The items, left to right. Use BeuiDockItem.separator to group them with a vertical rule.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
magnify bool
Opt in to the macOS-style cursor magnification (a Flutter-only enhancement; not in the React source). Defaults to false — the faithful flat dock.
final
maxScale double
Peak magnification of the item directly under the cursor. Only used when magnify is true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
Resting size (px) of each item.
final

Methods

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