The edits a layout tree admits, as pure functions: a tree in, a tree out, nothing mutated. Every one ends in normalise, so no caller ever sees a split of one, an empty group or a same-axis nesting.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
Static Methods
-
activate(
LayoutNode? root, String tabId) → LayoutNode? -
rootwith the tab withtabIdshown in its group. -
dock(
LayoutNode? root, DockSource source, DockTarget target, {DockPolicy policy = DockPolicy.permissive, String newId() = PanelIds.next}) → LayoutNode? -
The whole move:
sourcetaken out ofrootand put down attarget, if the tree andpolicyadmit it. Returns null when they do not, and when the move would change nothing — a tab dropped onto the centre of its own group, a panel dropped beside itself. The widget layer uses the null to decide what lights up, so the rules live here once. -
equalise(
LayoutNode? root, String splitId) → LayoutNode? -
rootwith every child of the split withsplitIdgiven an equal share: the way back from a divider dragged somewhere regrettable. -
insertBeside(
LayoutNode? root, String targetId, LayoutNode inserted, DockSide side, {String newId() = PanelIds.next}) → LayoutNode? -
rootwithinsertedbeside the node withtargetId, onside. -
join(
LayoutNode? root, String leafId, List< PanelTab> tabs, int? index) → LayoutNode? -
tabsjoining the leaf withleafIdatindex(or the end), the first of them becoming active. A single panel becomes a group under the same id, so anything keyed on the leaf survives the change of form. -
leafOf(
List< PanelTab> tabs, SurfaceForm form, String id, {bool persistent = false}) → LeafNode -
A new leaf of
formholdingtabs. A group ispersistentwhen the tabs came out of a persistent group: an editor area split in two is two editor areas, and normalise is what folds the empty one away later. -
normalise(
LayoutNode? node) → LayoutNode? -
The canonical form of
node: -
removeLeaf(
LayoutNode? root, String leafId) → LayoutNode? -
rootwithout the leaf withleafId, normalised. -
removeTab(
LayoutNode? root, String tabId) → LayoutNode? -
rootwithout the tab withtabId, normalised. A group down to no tabs is removed with it unless it is persistent; a group down to one stays a group. -
replace(
LayoutNode? root, String nodeId, LayoutNode? replacement) → LayoutNode? -
rootwithreplacementwhere the node withnodeIdwas. The root itself may be replaced. Unknown ids leave the tree as it is. -
replaceTab(
LayoutNode? root, PanelTab tab) → LayoutNode? -
rootwithtabin place of the tab with the same id — a title that changed, a flag that flipped. Unknown ids leave the tree as it is. -
swap(
LayoutNode? root, String splitId, int dividerIndex) → LayoutNode? -
rootwith the two children either side of dividerdividerIndexof the split withsplitIdexchanged, extents and all.