FieldCodec class

Defines presentation reads and canonical mutation behavior for one registered canvas field.

readNode and readScene are presentation readers. They may read resolved or otherwise effective runtime state and are used by getField().

Canonical mutation uses readCanonicalNode or readCanonicalScene together with writeCanonical. Canonical writers transform the supplied base scene and return the result. They must not start another editor commit.

Constructors

FieldCodec({required Object fallback, ReadNodeFn? readNode, ReadSceneFn? readScene, CanReadCanonicalNodeFn? canReadCanonicalNode, ReadCanonicalNodeFn? readCanonicalNode, ReadCanonicalSceneFn? readCanonicalScene, required WriteCanonicalFn writeCanonical, bool isSceneOnly = false})
const

Properties

canReadCanonicalNode → CanReadCanonicalNodeFn?
Returns whether this node is a valid canonical target for the field.
final
fallback → Object
final
hashCode → int
The hash code for this object.
no setterinherited
isSceneOnly → bool
True when this codec is valid only for the scene-fields pseudo target.
final
readCanonicalNode → ReadCanonicalNodeFn?
Reads the persisted/canonical value from the canonical base scene.
final
readCanonicalScene → ReadCanonicalSceneFn?
Reads the persisted/canonical value for a scene-level field.
final
readNode → ReadCanonicalNodeFn?
Presentation read from a runtime node and its effective scene context.
final
readScene → ReadCanonicalSceneFn?
Presentation read for a scene-level field.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
writeCanonical → WriteCanonicalFn
Applies field-specific normalization and canonical storage behavior.
final

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