sceneTextOwnProps top-level constant
What a text spells for itself, beside its style.
The line the two lists are drawn on is whether the property describes the
TYPE or the PARAGRAPH. A face, a size, a tracking, a stack of paint
passes are the treatment, and sharing them across a poster and a card is
the point of a style. Where the lines break and how they sit in the box
are the box's business: two texts in one display face routinely differ on
both, and a shared style that decided them would be one nobody could
share. Flutter draws the same line — align and maxLines are Text's
arguments, not TextStyle's.
The text itself is the positional argument, read and written through the table like the rest but spelled by hand.
Implementation
const sceneTextOwnProps = <SceneProp>[
SceneProp(
'text',
ScenePropKind.string,
owner: ScenePropOwner.text,
defaultValue: '',
byHand: true,
read: _text,
write: _setText,
),
// The treatment, whole. A node stores it as its resolved fields rather
// than as an object, which is what `read` and `write` are for; as a key it
// is an ordinary property whose type happens to be a text style.
SceneProp(
'style',
ScenePropKind.style,
owner: ScenePropOwner.text,
byHand: true,
read: _style,
write: _setStyle,
),
SceneProp(
'align',
ScenePropKind.choice,
owner: ScenePropOwner.text,
defaultValue: SceneTextAlign.left,
choices: _aligns,
read: _align,
write: _setAlign,
),
SceneProp(
'maxLines',
ScenePropKind.integer,
owner: ScenePropOwner.text,
read: _maxLines,
write: _setMaxLines,
),
];