TextNode class
Text node with a fixed layout box (size) and basic styling.
Constructors
- TextNode({required NodeId id, required String text, required Size size, double fontSize = 24, required Color color, TextAlign align = TextAlign.left, bool isBold = false, bool isItalic = false, bool isUnderline = false, String? fontFamily, double? maxWidth, double? lineHeight, double hitPadding = 0, Transform2D? transform, double opacity = 1, bool isVisible = true, bool isSelectable = true, bool isLocked = false, bool isDeletable = true, bool isTransformable = true})
- TextNode.fromTopLeftWorld({required NodeId id, required String text, required Size size, required Offset topLeftWorld, double fontSize = 24, required Color color, TextAlign align = TextAlign.left, bool isBold = false, bool isItalic = false, bool isUnderline = false, String? fontFamily, double? maxWidth, double? lineHeight, double hitPadding = 0, double opacity = 1, bool isVisible = true, bool isSelectable = true, bool isLocked = false, bool isDeletable = true, bool isTransformable = true})
-
Creates a text node positioned by its axis-aligned world top-left corner.
factory
Properties
- align ↔ TextAlign
-
getter/setter pair
- boundsWorld → Rect
-
Axis-aligned bounds in world coordinates.
no setterinherited
- color ↔ Color
-
getter/setter pair
- fontFamily ↔ String?
-
getter/setter pair
- fontSize ↔ double
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitPadding ↔ double
-
Additional hit-test tolerance in scene units.
(Serialized as part of JSON v2.)
getter/setter pairinherited
- id → NodeId
-
finalinherited
- isBold ↔ bool
-
getter/setter pair
- isDeletable ↔ bool
-
getter/setter pairinherited
- isItalic ↔ bool
-
getter/setter pair
- isLocked ↔ bool
-
getter/setter pairinherited
- isSelectable ↔ bool
-
getter/setter pairinherited
- isTransformable ↔ bool
-
getter/setter pairinherited
- isUnderline ↔ bool
-
getter/setter pair
- isVisible ↔ bool
-
getter/setter pairinherited
- lineHeight ↔ double?
-
getter/setter pair
- localBounds → Rect
-
Axis-aligned bounds in local coordinates.
no setteroverride
- maxWidth ↔ double?
-
getter/setter pair
- opacity ↔ double
-
Node opacity in the range
[0,1].getter/setter pairinherited - position ↔ Offset
-
Translation component of transform.
getter/setter pairinherited
- rotationDeg ↔ double
-
Derived rotation in degrees.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleX ↔ double
-
Derived X scale magnitude (convenience accessor).
getter/setter pairinherited
- scaleY ↔ double
-
Derived Y scale (convenience accessor).
getter/setter pairinherited
- size ↔ Size
-
getter/setter pair
- text ↔ String
-
getter/setter pair
- topLeftWorld ↔ Offset
-
Axis-aligned world top-left corner of this node's bounds.
getter/setter pair
- transform ↔ Transform2D
-
Local-to-world node transform.
getter/setter pairinherited
- type → NodeType
-
finalinherited
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