LayerRow class
One layer of the Layers panel (spec 12b D9): the current-layer mark, the eye, the lock, the colour swatch and its menu, and the name, which a double-click turns into an inline field.
Every control is disabled when enabled is false (D11). The mark is disabled on a hidden layer (decision 7); the eye's hide direction is disabled on the effective current layer (current), with a tooltip, while showing is always enabled (S-6). Layer 0 cannot be renamed.
The rename field (key layer-name-field-<hex>) opens while
editing. Enter commits a valid name — the text trimmed, checked by
validate — through onRename, once; an invalid one keeps the field
open with validate's reason under it. Escape, and focus loss with an
invalid name, close it and dispatch nothing; focus loss with a valid
name commits it as Enter does. Every way out calls onEndRename. The
field sits in a ShellShortcutGuard with a nearer Escape binding, as
the symbol search does, so no shell shortcut fires while typing.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LayerRow
Constructors
-
LayerRow({Key? key, required LayerRecord record, required bool current, required bool selected, required bool enabled, required bool editing, required int foreground, required VoidCallback onSelect, required VoidCallback? onMakeCurrent, required VoidCallback onToggleVisible, required VoidCallback onToggleLocked, required ValueChanged<
int> onColour, required VoidCallback onStartRename, required String? validate(String name), required ValueChanged<String> onRename, required VoidCallback onEndRename}) -
const
Properties
- current → bool
-
Whether this is the effective current layer (
drawingLayer).final - editing → bool
-
Whether the name field is open.
final
- enabled → bool
-
Whether the permissions allow the panel's commands (D11).
final
- foreground → int
-
The paper's foreground,
0xRRGGBB: ACI 7's colour.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onColour
→ ValueChanged<
int> -
final
- onEndRename → VoidCallback
-
final
- onMakeCurrent → VoidCallback?
-
Null when this row's mark has nothing to do (it is already current).
final
-
onRename
→ ValueChanged<
String> -
Commits a valid, trimmed name that differs from the record's.
final
- onSelect → VoidCallback
-
final
- onStartRename → VoidCallback
-
final
- onToggleLocked → VoidCallback
-
final
- onToggleVisible → VoidCallback
-
final
- record → LayerRecord
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool
-
Whether this row is the panel's selected row.
final
- validate → String? Function(String name)
-
The reason a trimmed name cannot be this layer's, or null.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LayerRow> -
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