model library

The Flutter-free half of fl_panel: the layout tree, its edits, the solver, the drop resolver, the policy and the file format.

Nothing reachable from this import touches package:flutter, so a tree can be built, edited, solved and serialised headless — in a plain dart test, on a server, in a tool. test/flutter_free_test.dart keeps it so.

Classes

DividerGeometry
Where a divider between two split children is drawn, and what it resizes.
DockCandidate
A drop that would be accepted, and where it would put the content. The preview is what the overlay shades: the target leaf for a join, the half the new leaf would take for a split.
DockFreshSource
DockHit
What the widget layer found under the pointer. The resolver turns it into a target; the widget layer only knows which rectangle it is over.
DockJoin
DockLeafHit
DockLeafSource
DockNoHit
DockPolicy
What may dock where. Two levels, one object.
DockResolver
Turns a pointer position into a dock target, or nothing.
DockRoot
DockSource
What is being moved.
DockSplit
DockStripHit
DockTabSource
DockTarget
Where it lands.
DockZones
Where over a leaf a drop joins it and where it splits it, and how near the window's edge a drop splits everything.
FixedExtent
FlexExtent
LayoutNode
A node of a window's layout tree.
LayoutResult
The solved layout of one window: a rectangle for every node, the dividers between them. Splits are in rects too — the drop resolver uses the root's bounds for its edge bands.
LayoutTree
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.
LeafNode
A node that shows content: a single panel or a tab group.
PanelExtent
How much of its parent a split child takes.
PanelIds
Fresh node ids.
PanelJson
The JSON shape of a PanelWorkspace, both ways.
PanelRect
An axis-aligned rectangle in whatever coordinate space the caller lays out in. The model and the solver import nothing from Flutter, so they carry their own; the widget layer converts at the edge.
PanelSolver
The pure function from tree to rectangles, and its inverse for one divider. Nothing here knows about widgets; the host calls layout with its constraints and positions children where the result says.
PanelTab
One piece of content in the layout.
PanelWindow
One window's worth of layout: a tree, or nothing.
PanelWorkspace
Every window of the application, in one value.
SinglePanel
SplitNode
TabGroup
TabPlacement
A tab and the window and leaf it is in.

Enums

DockSide
A side of a rectangle: where a dropped panel lands relative to a target.
PanelAxis
The axis a split lays its children along.
SurfaceForm
The two shapes a piece of content can be shown in.

Typedefs

TabResolver = PanelTab? Function(PanelTab tab)
Called with every tab read from a file. Return the tab to keep it — the same one or an adjusted one — or null to drop it: a content id this build no longer knows, a path that is gone. Dropped tabs take their empty leaves with them, so a stale file never restores an empty rectangle.

Exceptions / Errors

PanelFormatException
A layout file that cannot be read: a newer version than this build knows, or a shape that is not a layout at all.