LayoutTree class abstract final

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?
root with the tab with tabId shown in its group.
dock(LayoutNode? root, DockSource source, DockTarget target, {DockPolicy policy = DockPolicy.permissive, String newId() = PanelIds.next}) → LayoutNode?
The whole move: source taken out of root and put down at target, if the tree and policy admit 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?
root with every child of the split with splitId given 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?
root with inserted beside the node with targetId, on side.
join(LayoutNode? root, String leafId, List<PanelTab> tabs, int? index) → LayoutNode?
tabs joining the leaf with leafId at index (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 form holding tabs. A group is persistent when 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?
root without the leaf with leafId, normalised.
removeTab(LayoutNode? root, String tabId) → LayoutNode?
root without the tab with tabId, 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?
root with replacement where the node with nodeId was. The root itself may be replaced. Unknown ids leave the tree as it is.
replaceTab(LayoutNode? root, PanelTab tab) → LayoutNode?
root with tab in 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?
root with the two children either side of divider dividerIndex of the split with splitId exchanged, extents and all.