PlannerShell class
Owns the index, the camera and -- since 03 -- the outline cache and the grip cache for the document's lifetime; since 05, the tools and the Fill toggle. It lays out the chrome slots.
Since 12a the document comes from the DocumentHost, which keys the
shell by it (spec 12a D2): a new document is a new shell. The host also
passes the object-snap setting, which survives a swap, the file
commands, and the file state (name, dirty, busy) for the top bar of
spec 12a D7. Undo and Redo are the shell's own commands (D1, D6).
A bare shell is the test seam (spec 03, Architecture; Ruling 03-18; plan 12a P-4).
- document must carry a
FlutterTextMeasurer, which its caller owns. Without one the shell builds the empty document of spec 12a D4 (newDocument) over a measurer of its own, which it clears on dispose. - snap, when given, is the host's and is not disposed here (spec 12a D2, S-11); without one the shell owns a fresh one.
- With no fileCommands the toolbar shows Undo and Redo only.
- initialCamera replaces the nominal fit.
PlannerViewstill fits once after its first frame, so a test sets a camera of its own after the first pump.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PlannerShell
Constructors
-
PlannerShell({Key? key, DraftDocument? document, SnapSettings? snap, List<
ShellCommand> fileCommands = const <ShellCommand>[], String? documentName, ValueListenable<bool> ? dirty, ValueListenable<bool> ? busy, ShellSettleRegistrar? onSettle, ViewportTransform? initialCamera, SymbolLibraryLoader? symbols, SymbolThumbnails? thumbnails, TextEditingController? symbolSearch, SelectionController? selection, Listenable? fitRequests, CameraController? camera, bool fitOnStart = true, bool startFitIsRequest = false, VoidCallback? onFitted, ViewportTransform? framing(Size size)?, int cameraEpoch()?, bool userCamera = true, void onCanvasPlaced(Object view, Rect? global)?, Widget? tableOverlays, FloorPlanEditorBar editorBar = const FloorPlanEditorBar(), ShellIdleRegistrar? onIdle, FloorPlanEditorCapabilities capabilities = FloorPlanEditorCapabilities.full, ShellToolRegistrar? onTools, void onToolChanged(FloorPlanTool tool)?, bool shortcuts = true, bool autofocus = true, ShellTableInspector? tableInspector, ShellDeleteRegistrar? onDelete}) -
const
Properties
- autofocus → bool
-
Whether the canvas takes the focus when it is mounted (spec C-7),
forwarded to the view. A press on it asks for the focus either way;
a focused Material text field keeps it from the canvas on that press
unless its
onTapOutsidelets go (FloorPlanView.autofocus).final -
busy
→ ValueListenable<
bool> ? -
Whether a flow of the host is running (spec 12a D6); null in a bare
shell.
final
- camera → CameraController?
-
The host's camera (spec 14b-2 R-13): used and never disposed here,
so a mode switch keeps the view; initialCamera is then not read.
final
- cameraEpoch → int Function()?
-
Forwarded to the view: the host's camera epoch (host embedding API
spec G-3).
final
- capabilities → FloorPlanEditorCapabilities
-
What the editor lets its user do (host embedding API spec C-5), read
at each build, key and arming; the default is today's editor. A
change that refuses the active tool falls back to select. Its
toolsare expected to hold select (the view validates it); the shell allows select whatever they say.final -
dirty
→ ValueListenable<
bool> ? -
Whether the document differs from its save point (spec 12a D5); null
in a bare shell.
final
- document → DraftDocument?
-
final
- documentName → String?
-
The document's name, for the top bar (spec 12a D7); null in a bare
shell.
final
- editorBar → FloorPlanEditorBar
-
The top bar as the host shapes it (host embedding API spec C-2, S-2),
read at each build; the default is today's bar. It shapes the bar
only: every command stays bound to its chords (S-20).
final
-
fileCommands
→ List<
ShellCommand> -
The host's file commands (spec 12a D6): New, Open, Open sample, Save,
Save As, Export. The shell adds its own idle condition (no shape
part-way) to each, and its page to Export's (spec 13 D8), and binds
and shows them with Undo and Redo.
final
- fitOnStart → bool
-
Forwarded to the view: false when camera is already placed.
final
- fitRequests → Listenable?
-
Each notification refits the camera (spec 14b-2 H8), forwarded to the
view.
final
- framing → ViewportTransform? Function(Size size)?
-
Forwarded to the view: the camera a fit sets, asked when the fit is
performed (zone spec Z7); null fits the page.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCamera → ViewportTransform?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onCanvasPlaced → void Function(Object view, Rect? global)?
-
Forwarded to the view: where its drawing area is (spec G-2).
final
- onDelete → ShellDeleteRegistrar?
-
Where the shell registers its delete (spec C-3, S-16).
final
- onFitted → VoidCallback?
-
Forwarded to the view: called after each fit.
final
- onIdle → ShellDeleteRegistrar?
-
Where the shell registers its idle probe (spec S-4).
final
- onSettle → ShellSettleRegistrar?
-
Where the shell registers its settle (spec 12a D2).
final
- onToolChanged → void Function(FloorPlanTool tool)?
-
Told the active tool after each change (spec C-3, S-6), and select
once when the shell is created.
final
- onTools → ShellToolRegistrar?
-
Where the shell registers its tool selector (spec C-3, S-6).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selection → SelectionController?
-
The host's selection over document (spec 14b-2 H4, H8): used and
never disposed here, as snap; without one the shell owns its own.
final
- shortcuts → bool
-
Whether the shell binds its keys (host embedding API spec C-7, S-16),
read at each build and key: false binds none of the keys it binds
while no gesture runs (the command chords, F3, the tool letters, F,
Escape) and closes the select tool's idle keys (Delete, Backspace,
Escape), so they reach the host. A gesture's own keys stay (a drag's
Escape and Shift, a drawing tool's Escape and Enter, the symbol
tool's R and M). The commands stay callable.
final
- snap → SnapSettings?
-
final
- startFitIsRequest → bool
-
Forwarded to the view: whether that fit performs only a host's
request (Task 2 review R-1).
final
- symbols → SymbolLibraryLoader?
-
The app's symbol library loader (spec 09b D2), passed through the
host; not owned here. With it the left panel has two tabs, Tools and
Symbols (D8); null in a bare shell, which shows today's panel exactly.
final
- symbolSearch → TextEditingController?
-
The Symbols tab's search text (spec 09c D13), passed by the host, which
keeps it across document swaps; not disposed here. A shell given none
makes one of its own and disposes it. Read once, in
initState.final - tableInspector → ShellTableInspector?
-
The host's table inspector (spec C-6, S-18): built under the
Selection panel, and hidden with it, while the selection is exactly
one key and that key is a root-level table; rebuilt when that table
changes, at each document change and at each build of the shell,
never by the camera. Null builds no slot.
final
- tableOverlays → Widget?
-
The host's widgets on the tables when the host shows them in the
design mode (host embedding API spec G-5); null for none.
final
- thumbnails → SymbolThumbnails?
-
The app's symbol thumbnail cache (spec 09b D5), passed through the
host; not owned here. Read only with symbols: a shell given a loader
and no cache makes a cache of its own and disposes it.
final
- userCamera → bool
-
Forwarded to the view: false locks the user's pan and zoom (spec G-3).
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PlannerShell> -
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