TextLayer class sealed

One pass over a laid-out paragraph.

A text's paint stack is an ordered list of these, painted back to front, and the effect space is what combining them reaches: a drop shadow is a blurred offset fill, an outline is a stroke beneath the fill, sticker type is stroke-stroke-fill, extruded type is a dozen offset fills under a gradient one. None of those is a code path.

Layers are ANONYMOUS and immutable, and they live on the style rather than the node: a named per-node stack is a treatment nothing else can share, which defeats the point of a style. They must be immutable to sit inside a const Token<SceneTextStyle>, so an edit replaces the list and an animation composes a value rather than mutating one.

A pass may change paint, never layout. Every field here is paint; a metric one would give the passes two layouts to register against, and every effect would drift by a subpixel that grows along the line.

Implementers

Properties

blend → SceneBlendMode
How this pass lands on the passes beneath it and on what is behind the text.
final
blur → double
The glyph outline blurred, through a mask filter on this pass's own paint. Not the pass composited and blurred: that is a layer save per pass, and a different performance story.
final
box → SceneLayerBox
What paint is measured against: the whole text, or each line.
final
dx → double
final
dy → double
final
hashCode → int
The hash code for this object.
no setterinherited
opacity → double
final
paint → ScenePaint?
Null paints the text's own colour — which is what lets one stack serve several colours, and what a run's own colour reaches through.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({double? blur, double? dx, double? dy, double? opacity, SceneLayerBox? box, SceneBlendMode? blend}) → TextLayer
This pass with the fields given changed and the rest kept. Every edit and every rescale goes through here, so a field added to a pass is carried by all of them rather than dropped by whichever call site respelled the constructor and forgot it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
toWire() → Map<String, Object?>
withPaint(ScenePaint? paint) → TextLayer
This pass painted with paint instead — null included, which is "the text's own colour" and the one value copyWith cannot say, because there a null means "not given".

Operators

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

Static Methods

fromWire(Object? raw) → TextLayer?