TextNode class

Inheritance
Available extensions

Constructors

TextNode(String text, {String name = '', double x = 0, double y = 0, double? width, double? height, SceneColor? fill, SceneColor? borderColor, double borderWidth = 1, double corner = 0, double? cornerTopLeft, double? cornerTopRight, double? cornerBottomRight, double? cornerBottomLeft, double? minWidth, double? maxWidth, double? minHeight, double? maxHeight, double opacity = 1, bool visible = true, SceneTextAlign align = SceneTextAlign.left, int? maxLines, SceneTextStyle? style})
The ordinary text: one run, no deltas.
factory
TextNode.rich(List<TextRun> runs, {String name = '', double x = 0, double y = 0, double? width, double? height, SceneColor? fill, SceneColor? borderColor, double borderWidth = 1, double corner = 0, double? cornerTopLeft, double? cornerTopRight, double? cornerBottomRight, double? cornerBottomLeft, double? minWidth, double? maxWidth, double? minHeight, double? maxHeight, double opacity = 1, bool visible = true, SceneTextAlign align = SceneTextAlign.left, int? maxLines, SceneTextStyle? style})
A paragraph of several runs, each with its own delta over style — one paragraph, laid out and wrapped as one, which is the whole reason a bold word is not a second node beside the first.

Properties

align ↔ SceneTextAlign
getter/setter pair
axes ↔ Map<String, double>
The variable face's axes, by tag. Empty is "the font's own defaults".
getter/setter pair
bindings → Map<String, SceneBinding>
Where each property's value comes from, when it is not a literal: property key → SceneBinding.
finalinherited
borderColor ↔ SceneColor?
A line around the node, or none. Two fields rather than one value, because the file's vocabulary is flat named arguments and a Border(...) would be a construct the grammar does not have.
getter/setter pairinherited
borderWidth ↔ double
getter/setter pairinherited
children → List<SceneNode>
no setterinherited
color ↔ SceneColor
getter/setter pair
corner ↔ double
getter/setter pairinherited
corners ↔ SceneCorners
The corner radii. corner reads and writes them as one number — what they are for most nodes.
getter/setter pairinherited
decoration ↔ SceneTextDecoration
getter/setter pair
decorationColor ↔ SceneColor?
getter/setter pair
decorationStyle ↔ SceneTextDecorationStyle
getter/setter pair
decorationThickness ↔ double
getter/setter pair
fill ↔ SceneColor?
getter/setter pairinherited
fontFamily ↔ String?
The fields below are the style RESOLVED — the style's value where it set one, the table's default where it did not. The style itself is not kept, because the file spells the delta and the editor recomputes it: equal to the style is inherited, and there is no flag saying otherwise.
getter/setter pair
fontSize ↔ double
getter/setter pair
fx → Map<(Object, String), Object>
The evaluated plane: per-frame contributions composed OVER the authored values above, keyed by (writer, property) in writer-stack order — the order is normative (× does not bit-commute). Motion lanes and app Effects write here; Save never reads it; a cancelled writer clears its own entries and the authored value was never touched.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
height ↔ double?
getter/setter pairinherited
heightFills → bool
no setterinherited
italic ↔ bool
getter/setter pair
layers ↔ List<TextLayer>
The paint stack, back to front. Empty is the ordinary text: one pass, in color.
getter/setter pair
letterSpacing ↔ double
getter/setter pair
lineHeight ↔ double
getter/setter pair
maxHeight ↔ double?
getter/setter pairinherited
maxLines ↔ int?
How many lines before it is cut with an ellipsis, or null for as many as it takes. A banner filled per language is the reason: the layout that fits English has to survive German, and something has to give.
getter/setter pair
maxWidth ↔ double?
getter/setter pairinherited
measured ↔ SceneRect?
Laid-out rect in artboard coordinates, swept after each frame by whichever renderer measured it.
getter/setter pairinherited
minHeight ↔ double?
getter/setter pairinherited
minWidth ↔ double?
Bounds on the laid-out size, when a node has them: a card no narrower than its title, a column no wider than a line of reading. Null is no bound.
getter/setter pairinherited
name ↔ String
The node's identity — the field name in the file, and SOURCE-LEVEL ONLY. A compiled scene leaves it empty: Dart has no field-name reflection, and at runtime a node's identity is the object, which is what makes scene.headline a typed reference rather than a lookup. The editor, which parsed the source, is what fills this in.
getter/setter pairinherited
opacity ↔ double
getter/setter pairinherited
runs ↔ List<TextRun>
The paragraph, in runs. One run is the ordinary text; several are one paragraph with deltas along it.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text ↔ String
The text a node draws, as one string.
getter/setter pair
textCase ↔ SceneTextCase
getter/setter pair
typeName → String
no setteroverride
visible ↔ bool
Whether the node is drawn and laid out at all. Not opacity zero: a hidden node takes no room in a row, and a column closes over it. The boolean a component most often exposes — show the badge, hide the footer — which is why it is a property and not an effect.
getter/setter pairinherited
weight ↔ SceneFontWeight
getter/setter pair
width ↔ double?
Size along each axis, three-valued in one field:
getter/setter pairinherited
widthFills → bool
Whether this node takes what the parent gives along each axis.
no setterinherited
wordSpacing ↔ double
getter/setter pair
x ↔ double
getter/setter pairinherited
y ↔ double
getter/setter pairinherited

Methods

animate({MotionTrack? opacity, MotionTrack? translateX, MotionTrack? translateY, MotionTrack? scale, MotionTrack? rotate}) → AnimateGroup

Available on SceneNode, provided by the SceneNodeAnimate extension

animate({MotionTrack? opacity, MotionTrack? translateX, MotionTrack? translateY, MotionTrack? scale, MotionTrack? rotate, MotionTrack? fontSize, MotionTrack? letterSpacing, MotionTrack? wordSpacing, MotionTrack? lineHeight, MotionTrack? decorationThickness, MotionTrack? color, Map<String, MotionTrack>? axes}) → AnimateGroup

Available on TextNode, provided by the TextNodeAnimate extension

clearFxWriter(Object writer) → void
inherited
effect() → Effect
Mint an app-side fx writer. Handles are the only app surface — two independent effects on one property compose instead of colliding, and clearing one leaves the others (sketch 25).
inherited
fxRendered(String prop) → Object
The composed value the renderer should draw: authored base folded with every contribution through the derived operator table — opacity and scale multiply, translations and rotation add, everything else replaces in stack order.
inherited
hasFx(String prop) → bool
Whether any writer currently contributes to prop — the renderer asks this where the authored value's absence means something (a null fill draws no decoration; a composed fill draws one).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFx(Object writer, String prop) → void
inherited
toString() → String
A string representation of this object.
inherited
writeFx(Object writer, String prop, Object value) → void
inherited

Operators

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