Node class sealed

Runtime scene-graph node (hierarchical TRS).

Notes:

  • All nodes (including groups) have a real Transform2D.
  • Group nodes structurally own children (no groupId).
  • IDs are intended to be globally unique within the document.
  • Optional user-facing display names live in name.
  • Optional higher-level group semantics live in GroupNode.behavior. Core runtime does not interpret product/domain behavior types directly.
  • Sibling order is paint/stack order: earlier siblings paint behind later siblings.
Available extensions
Annotations
  • @Freezed.new(unionKey: 'runtimeType')

Constructors

Node.fromJson(Map<String, dynamic> json)
factory
Node.group({required NodeId id, String? name, @Default.new(false) bool hidden, @Default.new(false) bool locked, @Default.new(Transform2D()) Transform2D xf, GroupBehaviorRef? behavior, @Default.new(<Node>[]) List<Node> children})
const
factory
Node.icon({required NodeId id, String? name, @Default.new(false) bool hidden, @Default.new(false) bool locked, @Default.new(Transform2D()) Transform2D xf, required CanvasIconData data, String? role})
const
factory
Node.image({required NodeId id, String? name, @Default.new(false) bool hidden, @Default.new(false) bool locked, @Default.new(Transform2D()) Transform2D xf, required ImageData data, String? role})
const
factory
Node.path({required NodeId id, String? name, @Default.new(false) bool hidden, @Default.new(false) bool locked, @Default.new(Transform2D()) Transform2D xf, required PathData data, String? role})
const
factory
Node.text({required NodeId id, String? name, @Default.new(false) bool hidden, @Default.new(false) bool locked, @Default.new(Transform2D()) Transform2D xf, required TextData data, String? role})
const
factory

Properties

childrenOrEmpty List<Node>

Available on Node, provided by the NodeFields extension

no setter
copyWith → $NodeCopyWith<Node>
Create a copy of Node with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hidden bool
no setterinherited
hidden bool

Available on Node, provided by the NodeFields extension

no setter
id String
no setterinherited
id String

Available on Node, provided by the NodeFields extension

no setter
isGroup bool

Available on Node, provided by the NodeFields extension

no setter
locked bool
no setterinherited
locked bool

Available on Node, provided by the NodeFields extension

no setter
name String?
no setterinherited
name String?

Available on Node, provided by the NodeFields extension

no setter
role String?

Available on Node, provided by the NodeFields extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
xf Transform2D
no setterinherited
xf Transform2D

Available on Node, provided by the NodeFields extension

no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Node to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
withChildren(List<Node> kids) Node

Available on Node, provided by the NodeMutations extension

Only groups accept children; non-groups return themselves unchanged.
withHidden(bool hidden) Node

Available on Node, provided by the NodeMutations extension

withId(NodeId id) Node

Available on Node, provided by the NodeMutations extension

withLocked(bool locked) Node

Available on Node, provided by the NodeMutations extension

withName(String? name) Node

Available on Node, provided by the NodeMutations extension

withXf(Transform2D xf) Node

Available on Node, provided by the NodeMutations extension

Operators

operator ==(Object other) bool
The equality operator.
inherited